Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

水之!!!!附代码!!

Posted by wocha at 2012-07-13 12:48:06 on Problem 3173
#include<stdio.h>
int main()
{
int n,m,j,k,l;
while(~scanf("%d%d",&n,&m))
{
int d[44][44];
d[0][0]=m;
printf("%d",m);
int i;
for(i=1;i<n;i++)
{
d[0][i]=(d[0][i-1]+i)%9;
if(d[0][i]==0)
d[0][i]=9;
printf(" %d",d[0][i]);

}
printf("\n");
for(i=1;i<n;i++)
{
printf(" ");
for(j=0;j<i-1;j++)
{
printf("  ");

}
for(j=i;j<n;j++)
{
d[i][j]=(d[i-1][j]+1)%9;
if(d[i][j]==0)
d[i][j]=9;
printf(" %d",d[i][j]);
}
printf("\n");
}

}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator