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 457 at 2009-01-14 15:13:57 on Problem 3173
#include<stdio.h>
#include<string.h>
int main()
{
	int i,j,n,s;
	int a[100];
	while(scanf("%d%d",&n,&s)!=EOF)
	{
	 memset(a,0,sizeof(a));
	 for(i=0;i<n;i++)
	 	{
		 s=s+i;
		 if(s>9) s=s-9;		
		 a[i]=s;
		 //printf("**%d",a[i]);
		}
	  int g=0;
	  for(i=0;i<n;i++)
	  	{		 
		 for(j=1;j<=2*i;j++)
		 	printf(" ");
		 for(j=g;j<n-1;j++)
			 printf("%d ",a[j]);			
		 printf("%d",a[n-1]);
		 if(g!=n-1)
		 printf("\n");
		 g++;
		 for(j=g;j<n;j++)
		 	{
			 a[j]=a[j]+1;
			 if(a[j]>9) 
			 a[j]=a[j]-9;		
			}
		}
	}
}

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