#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
srand(time(NULL));
int answer = rand()%101; // Á¤´ä
int guess;
int tries = 0;
// ¹Ýº¹ ±¸Á¶
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;
}