U E D R , A S I H C RSS

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

데블스캠프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; 

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