C/C++2009. 3. 19. 23:20
#include <Stdio.h>
#include <stdlib.h>
#include <time.h>

int main(){
int Com,Player;
int Count=0;
int i;
srand(time(NULL));
rand();rand();rand();

printf("== Game Start ==\n");

while(1){
printf("Input Number(1~3) : ");
scanf("%d",&Player);
if( !(1 <= Player && Player <=3 ) ){
printf("범위가 잘못되었습니다. \n");
continue;
}

for(i=0;i<Player;i++){
printf("Count = %d \n",++Count);
if(Count==31){
printf("You Lose !! \n");
return 0;
}
}
printf("== Computer Turn ==\n");

if(Count==29){
Com = 1;
}else if(Count==28){
Com = 2;
}else if(Count==27){
Com = 3;
}else{
Com = rand()%3+1;
}
for(i=0;i<Com;i++){
printf("Count = %d \n",++Count);
if(Count==31){
printf("You Win !! \n");
return 0;
}
}
}
return 0;
}


쌤 ver. 이다
난 왜 안만들었는지..!?


Posted by 샤키