Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请帮忙看一下哪里错了?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator