Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

谁帮我看看为什么wa了

Posted by smileallthetime at 2009-02-27 23:23:27 on Problem 2719
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main(){
int i;
float num=9;
char str[30];
while((scanf("%s",str)!=0)&&(str[0]!='0')){
   int j=0;
   int x=0;
  for(i=0;i<(int)strlen(str);i++){
     if(str[i]>='4')
       j+=(int)pow(num,(int)strlen(str)-i-1);
       x+=(int)(str[i]-'0')*(int)pow(num,(int)strlen(str)-i-1);
 }
printf("%s: %d\n",str,x-j);
}
return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator