| ||||||||||
| 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:例子都对,就是过不了,running error!In Reply To:例子都对,就是过不了,running error! Posted by:Nedvid at 2008-03-07 19:39:47 老大。。是100万位。。。
> #include<stdio.h>
> #include<string.h>
> #include<stdlib.h>
> #include<math.h>
> void main()
> {
> char s[100],str[100],*end,*c;
> long a,b,sum,n=1,k;int i;
> while(scanf("%s",str)&&str[0]!='0')
> {
> for(i=1;i<=10;i++)
> {
> k=strlen(str);
> sum=strtol(str,&end,10);
> sum=sum+i*pow(10,k);
> if(sum%11==0)
> {b=sum/11;printf("%ld. %ld\n",n,b);break;}
> else if(i>=10)printf("%ld. IMPOSSIBLE\n",n);
> }
> n++;
> }
> }
>
>
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator