| ||||||||||
| 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 | |||||||||
Re:请大家指教我错在哪里。。郁闷中……In Reply To:请大家指教我错在哪里。。郁闷中…… Posted by:chuizi_nudt at 2006-04-22 15:36:04 > #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