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 thincal at 2004-04-24 11:22:27 on Problem 1653
#include<stdio.h>
#define MAX 10
void main()
{
	int i,j,n;
	int a[MAX];
	while(1)
	{
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		{
			for(j=i;j>=0;j--)
			   if(i!=j&&j!=0)
				   a[j]=a[j-1]+a[j];
			   else a[j]=1;
		    for(j=0;j<=i;j++)
			  printf("%-4d",a[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