Á¤¼ºÈÆ
    game.c (±³Àç)
  http://itsys.hansung.ac.kr/cgi-bin/onlineTest/viewCcoding/onlineCcoding.cgi?source=src/chap06/game.c



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
 
int main(void)
{   
       int answer;     // Á¤´ä
       int guess;
       int tries = 0
        srand(time(NULL));
        answer = rand()% 100;
       // ¹Ýº¹ ±¸Á¶ 
       do {
             printf("Á¤´äÀ» ÃßÃøÇÏ¿© º¸½Ã¿À: ");
             scanf("%d"&guess);
             tries++;
    
             if (guess >answer)  // »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ Á¤¼ö°¡ Á¤´äº¸´Ù ³ôÀ¸¸é
                    printf("Á¦½ÃÇÑ Á¤¼ö°¡ ³ô½À´Ï´Ù.\n");
             if (guess <answer)  // »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ Á¤¼ö°¡ Á¤´äº¸´Ù ³·À¸¸é
                    printf("Á¦½ÃÇÑ Á¤¼ö°¡ ³·½À´Ï´Ù.\n");
       } while (guess !=answer);
       
       printf("ÃàÇÏÇÕ´Ï´Ù. ½ÃµµÈ½¼ö=%d\n", tries);
       return 0;
}
cs

  µî·ÏÀÏ : 2022-02-22 [02:14] Á¶È¸ : 1672 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûndigits.c (±³Àç)
¡ä ´ÙÀ½±Ûmenu.c (±³Àç)
ÇÁ·Î±×·¡¹Ö¾ð¾î ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
lMini Project (¾îµåº¥Ã³ °ÔÀÓ ¸¸µé±â) Ãß°¡ ±¸Çö // ¡Ú¡Ú¡Ú ±â¸»°úÁ¦ °ÔÀÓ±¸Çö ½Ã Âü°í
l½Ç½À ¸ñÂ÷
121 ¦¦❶ ldivisor.c (±³Àç) 1685 02-22
120 ¦¦❶ linterest.c (±³Àç) 1571 02-22
119 ¦¦❶ lfactorial(for).c (±³Àç) 1718 02-22
118 ¦¦❶ ldraw_box.c (±³Àç) 1617 02-22
117 ¦¦❶ lsum(for).c (±³Àç) 1672 02-22
116 ¦¦❶ lndigits.c (±³Àç) 1590 02-22
115 ¦¦❶ lgame.c (±³Àç) 1672 02-22
114 ¦¦❶ lmenu.c (±³Àç) 1470 02-22
113 ¦¦❶ lclock.c (±³Àç) 1641 02-22
112 ¦¦❶ lpaper.c (±³Àç) 1742 02-22
111 ¦¦❶ lsum.c (±³Àç) 1662 02-22
110    ¦¦❷ sum.c (Ãß°¡) ´Ù¸¥ ¹üÀ§ 1578 03-20
109       ¦¦❸ sum.c (Ãß°¡) Á¶°Ç Ãß°¡ 1670 03-20
108 ¦¦❶ lgugu.c (±³Àç) 1733 02-22
107 ¦¦❶ lfactorial.c (±³Àç) 1791 02-22
106 ¦¦❶ lmile2.c (±³Àç) 1620 02-22
105 ¦¦❶ lwhile1.c (±³Àç) 1649 02-22
104 ¦¦❶ lteacher.c (±³Àç) 1614 02-22
103 ¦¦❶ lmile1.c (±³Àç) 1747 02-22
102 (5Àå) Á¶°Ç¹® 1101 02-21

[1][2][3][4][5][6][7][8][9][10]-[Next][15]