U E D R , A S I H C RSS

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



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.





/2012
/2012/
* 남

#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.0146 sec