More actions
Describe 데블스캠프2010/다섯째날/ObjectCraft/미션1/김정욱 here
- include<stdio.h>
- include<stdio.h>
struct craft{
char zergling; int attack; int def; int hp ; };
int main() { struct craft zergling[2]; zergling[0].attack=10; zergling[0].def=0; zergling[0].hp=100;
zergling[1].attack=5; zergling[1].def=0; zergling[1].hp=50;
while(1){
zergling[0].hp -= zergling[1].attack; printf("저글링1-->저글링0공격 저글링[0]의 hp = %d \n",zergling[0].hp) ; if (zergling[0].hp==0){ break; } zergling[1].hp -= zergling[0].attack; printf("저글링0-->저글링1공격 저글링[1]의 hp = %d \n",zergling[1].hp) ; if (zergling[1].hp==0){ break;}
}
if(zergling[0].hp==0)
printf("저글링[0]이 죽었어요 ㅄ저글링\n");
if(zergling[1].hp==0) printf("저글링[1]이 죽었어요 ㅄ 저글링\n");
return 0;