~cpp #include <iostream.h> void main(void) { int i,j,n; for(i=0; i<5; i++){ for(j=0; j<=i; j++){ cout<<"*"; } cout<<" "; for(n=5; n>i; n--){ cout<<"*"; } cout<<"\n"; } }두번째
~cpp #include <iostream.h> void main(void) { long i, j, fact=1; cout <<"수를 입력하세요"; cin >> i; for(j = 1; j <= i; j++) { fact *= j; } cout << fact; }