U E D R , A S I H C RSS

파스칼삼각형/임다찬

~cpp
#include <stdio.h>
int main(void){
	const int MAX = 100;
	int i,j;
	int row;
	int pascalt[MAX+1][MAX]={0,};

	printf("Row 값을 입력하세요 : "); scanf("%d",&row);

	for(i=1;i<=row;i++){
		pascalt[i][0]=1;
		for(j=0;j<i;j++){
			if(i>=1){
                	pascalt[i+1][j+1]=pascalt[i][j]+pascalt[i][j+1];                	
			}
            printf(" %d",pascalt[i][j]);
		}		
        printf("\n");
    }
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:23
Processing time 0.0164 sec