| ||||||||||
| 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 | |||||||||
.........你一直只贴代码什么都不说,怎么看?In Reply To:为什么错呀 帮忙看看 Posted by:wangfengtian at 2008-12-08 20:32:46 > #include<stdio.h>
> #include<string.h>
> int main()
> {
> int n,i,a[10]={9,3,7,9,3,7,9,3,7},j,sum,d,k,t;
> char b[100000][10];
> scanf("%d",&n);
> for(i=0;i<n;i++)
> {
> scanf("%s",b[i]);
> for(j=strlen(b[i])-1,t=j,sum=0;j>=0;j--)
> if(b[i][j]!='?')
> sum=sum+(b[i][j]-48)*a[t-j];
> else
> k=j;
> d=sum/10*10+10-sum;
>
> while(d%a[t-k]!=0)
> {
> d=d+10;
> }
> b[i][k]=d/a[t-k]+48;
> printf("Scenario #%d:\n%s\n\n",i+1,b[i]);
>
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator