U E D R , A S I H C RSS

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

== 데블스캠프2006/월요일/연습문제/for/김대순 ==
첫번째
~cpp
#include<iostream.h> 
void main() 
{ 
    int i,j; 
    int a,b; 

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

    for(a=0;a<5;a++) 
    { 
        for(b=4;b>=a;b--) 
        { 
            cout<<"*"; 
        } 
        cout<<" "<<"\n"; 
    } 

     
} 
두번째
~cpp
#include<iostream.h> 
void main() 
{ 
    int i,j; 
    int s=1; 
     
    cin >> i; 

    if(i<=10){ 
    for(j=1;j<=i;j++) 
        s=s*j; 

    cout<< s; 
    } 

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