| ||||||||||
| 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 | |||||||||
贴上代码 自测的数据挺顺利的 为什么WA呢?
int main()
{long n,a[100000],b[100000],c[100000],i;
long qufan(long x);
scanf("%d",&n);
for (i=1;i<=n;i++) scanf("%d %d",&a[i],&b[i]);
for (i=1;i<=n;i++)
{a[i]=qufan(a[i]);
b[i]=qufan(b[i]);
c[i]=a[i]+b[i];
c[i]=qufan(c[i]);
}
for (i=1;i<=n;i++) printf("%d\n",c[i]);
return 0;
}
long qufan(long x)
{long m[10],j,k,s;
j=1;
k=x % 10;
while (x!=0)
{m[j]=k;
x=x-k;
x=x/10;
k=x%10;
j++;
}
s=0;
j--;
for (k=1;k<=j;k++)
{s=s+m[k];
s=s*10;
}
s=s/10;
return(s);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator