U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/for/김준석

데블스캠프2006/월요일/연습문제/for/김준석

첫번째
~cpp
#include<iostream> 
using namespace std; 

void main(){ 

    int i,j; 

    for(i=0;i<5;i++){ 
        for(j=0;j<=i;j++) 
            cout << "*"; 
        cout << endl; 
    } 

    cout << endl; 

    for(i=0;i<5;i++){ 
        for(j=0;j<=i;j++) 
            cout << " "; 
        for(j=0;j<5-i;j++) 
            cout << "*"; 
     
        cout << endl; 
} 
} 
두번째
~cpp
#include<iostream> 
using namespace std; 

void main(){ 

    int i; 
    int sum=1; 

    cout << "10이하의 숫자를 입력해 주세요 " << endl; 
    cin >> i; 

    for(;i>0;){ 

        sum *= i--; 
    } 

    cout << sum << endl; 
} 

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:02
Processing time 0.0101 sec