U E D R , A S I H C RSS

데블스캠프2006/월요일/함수/문제풀이/윤성준

윤성준

1번
~cpp
#include <iostream>

using namespace std;


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

int main(void)
{	

	int member, gun, boat;
	
	cin >> member;
	cin >> gun;
	cin >> boat;

	team684(member, gun, boat);

	return 0;
}

bool team684(int member, int gun, int boat)
{
		
	if (member >= 3 && gun >= 2 && boat >= 1) {
		cout << "success";
	} else {
		cout << "fail";
	}
		
	
	return 0;
}
2번
~cpp
#include <iostream>

#include <time.h>

using namespace std;

int dice();

int main(void)
{
	
	srand((unsigned)time(NULL));

	cout << dice();

	return 0;
	
}

int dice()
{
	
	return rand()%6 + 1;

}


3번
~cpp
#include <iostream>

using namespace std;

void s1();
void s2();
void s3();
void s4();
void s5();
void s6();
void s7();
void prin();

void main(void)
{
	s1();
}

void s1()
{
	cout << "1" << endl;

	s2();
	s3();
	s4();
	s5();
	s6();
	s7();

}

void s2()
{
	cout << "2" << endl;

	s3();
	s4();
	s5();
	s6();
	s7();
	
}

void s3()
{
	cout << "3" << endl;

	s4();
	s5();
	s6();
	s7();


}

void s4()
{
	cout << "4" << endl;

	s5();
	s6();
	s7();

}

void s5()
{
	s6();
	s7();
	
	cout << "5" << endl;
}

void s6()
{
	cout << "6" << endl;
	
	s7();
	
}

void s7()
{
	cout << "7" << endl;
	
	prin();

}

void prin()
{
	cout << "공주" << endl;
}

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