2 ¶
-과 , , GCC, , main, , Data Type, , 기 , -
간 꼭 ! (거 궁 )
1. Ice Breaking Wiki 기.
2. 과 , 고 기, 그고 간 기. 간 기. 과과.
3. 결과 기
4. API 게 기 http://winapi.co.kr -> 2 Q&A
5. Wiki 게 기
1. 게
http://wiki.zeropage.org/wiki.php/교/2011//4
게 + 기 게!
http://wiki.zeropage.org/wiki.php/교/2011//4
게 + 기 게!
/// 기 게!!
#include<stdio.h>
#include<math.h> //Rand
#include<stdlib.h>
#include<time.h>
#define KICK 350
#define PUNCH 200
#define SORAKICK 900
#define SORAPUNCH 1000
int main(){
// , 기.
int Sora = 2500, My = 5000;
int temp; // 계
char select; //
srand(time(NULL)); //Rand 값 경.
printf("기 게 .\n");
printf(" : 06 11 Target : 11 \n");
while(1){
printf(" : %d\n",Sora);
printf(" : %d\n",My);
printf("기 : k : p\n");
//공격
select = getch(); //getch() char .
switch(select){
default: printf(" \n"); break;
case 'k' :
temp = ( ( rand() % KICK +1)); //1~KICK까 .
printf(" . : %d !\n",temp);
Sora = Sora - temp; break;
case 'p' :
temp = ( ( rand() % PUNCH +1));
printf(" . : %d !\n",temp);
Sora = Sora - temp; break;
} //공격
select = rand() %2 +1;// .
switch(select){
case 1 :
temp = ( ( rand() % SORAKICK +1));
printf(" . : %d !\n",temp);
My = My - temp; break;
case 2 :
temp = ( ( rand() % SORAPUNCH + 1));
printf(" . : %d !\n",temp);
My = My - temp; break;
}// 공격
//공격
// 그고
if(Sora <= 0 && My <= 0){
printf("Double KO. .\n");
break;
}
else if(Sora <= 0){
printf(" 겼!!! \\(* ^ * )/ \n");
break;
}
else if(My <= 0 ){
printf("게 .. OTL \n");
break;//while 간.
}
// ?
}
printf("\nGame Over\n");
return 0;
}
게 게 겠? .2. Q&A( 고, ! 공 고 )
2.1
2.1
2.2 #include<stdio.h>, printf(), scanf(); .
2.3 int, char, .
2.4 #define ,
2.5 #include<math.h>, #include<stdlib.h>, #include<time.h>
srand(time(NULL)), rand(). .
srand(time(NULL)), rand(). .
2.6 If, switch() { case : default : } .
3. 과
ACM 간 겠. 과 *^_^* ~!
ACM 간 겠. 과 *^_^* ~!
3.1 기 http://koistudy.net/?mid=prob_page&NO=152
3.2 기 http://koistudy.net/?mid=prob_page&NO=111
3.3 기 http://koistudy.net/?mid=prob_page&NO=145
3.4 http://koistudy.net/?mid=prob_page&NO=213
3.2 기 http://koistudy.net/?mid=prob_page&NO=111
3.3 기 http://koistudy.net/?mid=prob_page&NO=145
3.4 http://koistudy.net/?mid=prob_page&NO=213
: zeldababo : rlawns
격 ~! 고 !










