U E D R , A S I H C RSS

데블스캠프2006/월요일/함수/문제풀이/김대순

~cpp
#include<iostream.h>

bool team684(int member, int gun, int boat)
{

      return member+gun+boat;
}

main()
{
    int power; 
	power=team684(100,100,50);
    cout<<power;
}

== 주사위 ==

~cpp
#include<iostream>
#include<time.h>


using namespace std;

int dice(void)
{
	 
     return rand()%6+1;
     
}
int main()
{
     
	srand((unsigned)time(NULL));
	cout<<dice();
}

== 중첩 ==

~cpp
#include<iostream>
using namespace std;
void snow();
void nan1();
void nan2();
void nan3();
void nan4();
void nan5();
void nan6();
void nan7();


void nan1()
{
snow();
nan2();
nan3();
nan4();
nan5();
nan6();
nan7();
}
void nan2()
{
nan3();
nan4();
nan5();
nan6();
nan7();
}
void nan3()
{
nan4();
nan5();
nan6();
nan7();
}
void nan4()
{
nan5();
nan6();
nan7();
}
void nan5()
{
nan6();
nan7();
}
void nan6()
{
nan7();
}
void nan7()
{
snow();
}
void snow()
{
   cout<<"oops!";
}
void main()
{
nan1();     
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:04
Processing time 0.0150 sec