#include <stdio.h>
int main(void)
{
int answer; // Á¤´ä
int guess;
int tries = 0;
// ¹Ýº¹ ±¸Á¶
answer = srand(time(NULL))%100;
do {
printf("Á¤´äÀ» ÃßÃøÇÏ¿© º¸½Ã¿À (1 ~ 100): ");
scanf("%d", &guess);
tries++;
if (guess > answer) // »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ Á¤¼ö°¡ Á¤´äº¸´Ù ³ôÀ¸¸é
printf("Á¦½ÃÇÑ Á¤¼ö°¡ ³ô½À´Ï´Ù.\n");
if (guess < answer) // »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ Á¤¼ö°¡ Á¤´äº¸´Ù ³·À¸¸é
printf("Á¦½ÃÇÑ Á¤¼ö°¡ ³·½À´Ï´Ù.\n");
} while (guess != answer);
printf("ÃàÇÏÇÕ´Ï´Ù. ½ÃµµÈ½¼ö=%d\n", tries);
return 0;
}