U E D R , A S I H C RSS

새싹교실/2012/아우토반/앞반/4.12

Contents

1.
2.
3.
4.
5.


1.


O
O
O

2.

  • rand, srand
  • time(NULL)


3.


1. .
:
1) 플 0
2)
3) 플 택할 : , 킥
4)
-
: 1000
: 500
-
: 50~100
: 80~100
킥 : 50~150

2. .



4.

  • : F4(ThreeFs + Future Action Plan) .
    • : ThreeFs, ThreeFs(크), FiveFs(크)

      • Facts, Feelings, Findings, Future Action Plan. , , , , 획.
      • : " 5 .() .() .() .( 획)"



5.






#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'      확히 .
  ㅠㅠ

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:46
Processing time 0.0162 sec