Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请大家指教我错在哪里。。郁闷中……#include <stdio.h> #include <math.h> #include <string.h> char a[10]; int res,b,i,la; int main() { while(1) { scanf("%s",a); la=strlen(a); if(strcmp(a,"0")==0) break; res=0; for(i=la-1;i>=0;i--) { b=(int)(a[i]-'0'); if(b>=4) b--; res+=b*(int)pow(9,la-i-1); } printf("%d\n",res); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator