| ||||||||||
| 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了。。。求解#include <stdio.h>
int a[22][22];
int main()
{
int n,s,i,j,count;
scanf("%d%d",&n,&s);
a[0][0]=s;
printf("%d",s);
for(i=1;i<n;i++)
{
a[0][i]=a[0][i-1]+i;
if(a[0][i]>9) a[0][i]%=9;
printf(" %d",a[0][i]);
}
printf("\n");
for(i=1;i<n;i++)
{
for(j=1;j<2*i;j++)
printf(" ");
for(j=i;j<n;j++)
{
a[i][j]=a[i-1][j]+1;
if(a[i][j]>9) a[i][j]%=9;
printf(" %d",a[i][j]);
}
printf("\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator