~cpp #include <iostream.h> bool team684(int, int, int); void main(void){ int member, gun, boat; cin >> member; cin >> gun; cin >> boat; team684(member, gun, boat); } bool team684(int member, int gun, int boat){ int power; power=(member+gun)*2+boat/2; if(power>100){ cout <<"success"; } else{ cout <<"failed"; } return 0; }
~cpp #include <iostream> using namespace std; #include <time.h> int dice(void); void main(void){ srand((unsigned)time(NULL)); cout <<dice(); } int dice(void){ return rand()%6+1; }
~cpp #include <iostream> using namespace std; #include <time.h> int a(void); void snow(void); void s1(void); void s2(void); void s3(void); void s4(void); void s5(void); void s6(void); void s7(void); void main(void) { srand(unsigned(time(NULL))); if(a()==1){ s1(); } if(a()==2){ s2(); } if(a()==3){ s3(); } if(a()==4){ s4(); } if(a()==5){ s5(); } if(a()==6){ s6(); } if(a()==7){ s7(); } } void snow(void) { cout<<"즐"; } void s1(void) { s2(); s3(); s4(); s5(); s6(); s7(); } void s2(void) { s3(); s4(); s5(); s6(); s7(); } void s3(void) { s4(); s5(); s6(); s7(); } void s4(void) { s5(); s6(); s7(); } void s5(void) { s6(); s7(); } void s6(void) { s7(); } void s7(void){ snow(); } int a(void) { return (rand()%7+1); }