U E D R , A S I H C RSS

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

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

첫번재
~cpp
#include <iostream> 


using namespace std; 


int main (void) 
{ 
     
    int p, n; 

    for (p = 1; p <= 5; p++) { 
         
        for (n = 1; n <= p; n++) { 
            cout << "*"; 
        } 
         
        cout << endl; 
    } 

        cout << endl; 
         
    for (p = 1; p <= 5; p++) { 
         
        for (n = 1; n <= 6-p  ; n++) { 
            cout << "*"; 
        } 

        cout << endl; 
    } 

     
    return 0; 

} 

두번째
~cpp
#include <iostream> 


using namespace std; 

int main (void) 
{ 
     
    int f, factn, res = 1; 

    cin >> f; 
     
    if (f <= 10) { 
     
        for (factn = 1; factn <= f; factn++) { 
            res *= factn; 
        } 

        cout << res; 

    } 
     
     
    return 0; 

} 

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