No older revisions available
No older revisions available
데블스캠프2006/월요일/연습문제/for/윤영준 ¶
첫번째
~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; }