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 piaofushi919 at 2005-01-08 12:31:18 on Problem 1653
#include<malloc.h>
void main(){
	int n;
	int *row1;
	int *row2;
	int i,j;
	row1=(int*)malloc(n*sizeof(n));
	row2=(int*)malloc(n*sizeof(n));
	if(!row1||!row2)
		return;
	row1[0]=1;
	printf("%d\n,row1[0]");
	for(i=2;i<=n;i++){
		row2[0]=row1[0];
		for(j=1;j<i;j++){
			if(j!=i-1)
				row2[j]=row1[j]+row[j-1];
			else row2[j]=row1[j-1];
		}
		for(j=0;j<i;j++){
			printf("%d ",row2[j]);
			row1[j]=row2[j];
		}
		printf("\n");
	}
	free(row1);
	free(row2);
}

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