U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/for/정승희

데블스캠프2006/월요일/연습문제/for/정승희

for문 1번
~cpp
#include <iostream> 
using namespace std; 

int main() 
{ 
    for(int i=0;i<5;i++) 
    { 
        for(int j=0;j<=i;j++) 
            cout << "*"; 
        cout <<"\n"; 
    } 
    for(i=0;i<5;i++) 
    { 
        for(int j=0;j<=i;j++) 
            cout << " "; 
        for(j=5;j>i;j--) 
            cout << "*"; 
        cout<<"\n"; 
    } 

   return 0; 
} 
for문 2번

~cpp
#include <iostream> 
using namespace std; 

int main() 
{ 
/////////////!////////////////// 
    int n,s=1; 
    cin >> n; 
    if(n<10){ 
    for(int i=1;i<=n;i++) 
        s=i*s; 
    } 
    cout << s; 
   return 0; 
} 

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