U E D R , A S I H C RSS

데블스캠프2010/다섯째날/Object Craft/미션1/김정욱

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 zergling2;
zergling0.attack=10;
zergling0.def=0;
zergling0.hp=100;

zergling1.attack=5;
zergling1.def=0;
zergling1.hp=50;

while(1){
zergling0.hp -= zergling1.attack;
printf("저글링1-->저글링0공격 저글링0의 hp = %d \n",zergling0.hp) ;
if (zergling0.hp==0){
break; }
zergling1.hp -= zergling0.attack;
printf("저글링0-->저글링1공격 저글링1의 hp = %d \n",zergling1.hp) ;
if (zergling1.hp==0){
break;}


}
if(zergling0.hp==0)
printf("저글링0이 죽었어요 ㅄ저글링\n");

if(zergling1.hp==0)
printf("저글링1이 죽었어요 ㅄ 저글링\n");

return 0;
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:10
Processing time 0.0224 sec