Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

데블스캠프2010/다섯째날/ObjectCraft/미션1/박재홍: Difference between revisions

From ZeroWiki
imported>xf23t
No edit summary
imported>xf23t
No edit summary
Line 1: Line 1:
Describe 데블스캠프2010/다섯째날/ObjectCraft/미션1/박재홍 here
Describe 데블스캠프2010/다섯째날/ObjectCraft/미션1/박재홍 here


==zerg.c==
== zerg.c ==
  #include <stdio.h>
  #include <stdio.h>
   
   

Revision as of 05:22, 26 June 2010

Describe 데블스캠프2010/다섯째날/ObjectCraft/미션1/박재홍 here

zerg.c

#include <stdio.h>


struct zergling{

	int attack;
	int defense;
	int HP;

};
int main()
{
	int dam1,dam2=0;
	struct zergling a;
	struct zergling b;

	a.attack=5;
	a.defense=0;
	a.HP=50;

	b.attack=5;
	b.defense=0;
	b.HP=50;

	dam1=a.attack-b.defense;
	dam2=b.attack-a.defense;
	
	while(a.HP>0)
	{
		
		a.HP-=dam1;
		printf("저글링  b가 저글링 a에게 데미지 %d를 입혀 HP가 %d가 되었습니다.\n",dam1,a.HP);

		


	}

	printf("저글링 a가 죽었습니다.\n");

	return 0;
		

}