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

} 
Retrieved from http://wiki.zeropage.org/wiki.php/데블스캠프2006/월요일/연습문제/for/윤영준
last modified 2021-02-07 05:29:03