#include<stdio.h>
#include<time.h>
#include<math.h>
#include<stdlib.h>
void main(){
int Sundae = 1000;
int Player = 500;
int sundaeattack;
int userkick;
int userpunch;
int user_attack_type;
printf(" 기 게 start!\n");
printf(" : %d\n",Sundae);
printf(" : %d\n",Player);
printf(" 공\n");
srand((unsigned)time(NULL));
while(Sundae>=1){
sundaeattack = rand()%101+50;
Player - sundaeattack;
printf("Player %d .\n",sundaeattack);
printf("User 공격 : Punch = p , Kick = k : \n");
scanf("%c",&user_attack_type);
for(Player;Player<=0;)
{
if(user_attack_type == 'p'){
userpunch = rand()%101+80;
Sundae - userpunch;
printf("User %d .\n",userpunch);
}
if(user_attack_type == 'k'){
userkick = rand()%151+50;
Sundae - userkick;
printf("User %d .\n",userkick);
}
continue;
}
if(Sundae <= 0 && Player <= 0){
printf(" 금ㅠ\n");
break;
}
else if(Sundae <= 0){
printf(" E겼 !!EE!!\n");
break;
}
else if(Player <= 0){
printf("게 금ㅠ\n");
break;
}
}
printf("게 !..\n");
system("pause");
}
for 계 .... ... 게 ...
continue 과 switch case 'p' 게 경 겠.
ㅇㅠㅠ