하
.
파형 하 .
.
파형 하 .
#include <iostream>
using namespace std;
void printArray(int *arr, int n); // 행 하 함
void copyArray(int *fArr, int *arr); // 행 하 함
int column;
int main(){
cout << "한 파형 해(ex,6).";
cin >> column;
if(column > 0){
int *array = new int[column]; // 행
int *foreArray = new int[column]; //() 행
for(int i = 0; i<column; i++){
array[0] = 1; //행 1
for(int j = 1; j < column-1; j++){ // 2 한
array[j] = foreArray[j-1] + foreArray[j];
}
array[i] = 1; //행 1
printArray(array, i); //행 한.
copyArray(foreArray, array); //했 행 하 행 해 화해.
}
}
else
cout << " ."<< endl;
return 0;
}
void printArray(int *arr, int n){
int blank = (column - n)/2;
for(int j = 0;j < blank; j++){ //행
cout << " ";
}
for(int i = 0; i <= n; i++){ //
cout << arr[i] << " ";
}
cout << endl;
}
void copyArray(int *fArr, int *arr){
for(int i = 0; i < column; i++){
fArr[i] = arr[i];
arr[i] = 0;
}
}










