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 810974380 at 2009-08-29 15:48:16 on Problem 3173 and last updated at 2009-08-29 15:50:23
哪位高手帮忙看看吧~

Problem: 3173  User: 810974380 
Memory: N/A  Time: N/A 
Language: C  Result: Wrong Answer 

Source Code 
#include<stdio.h>
#include<stdlib.h>
int a[30];
int main()
{
  int i,j,k,n,s;
  scanf("%d%d",&n,&s);
  for(i=1;i<=n;i++)
  {  
	a[0]=s+i-1;
	for(j=1;j<n;j++)
	 {
		a[j]=(a[j-1]+j);
		if(a[j]>9)
		a[j]=(a[j-1]+j)%9;
	 }
	if(i>1)
	{
	  for(k=0;k<i-1;k++)
             a[k]=0;
        }
	for(j=0;j<n;j++)
	{
	if(a[j]==0)
	putchar(' ');
	else
	printf("%d",a[j]);
	if(j<n-1)
	putchar(' ');
        }
    putchar('\n');
 }
 system("pause");
 return 0;
}

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