|
http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=33096 [º¹»ç]
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
srand(time(NULL));
int ran = rand()%11+1;
int in;
real:
printf("Input a number (0~10) : ");
scanf("%d",&in);
if(in > 10){
printf("\nPlease input a number between 0 and 10.\n");
goto real;}
if(in < 0){
printf("\nPlease input a number between 0 and 10.\n");
goto real;}
if(in == ran){
printf("\nWow~ that's my favorite number!");
return 0;}
else{
printf("\nYour wrong. I don't like that number.\n");
printf("input again.\n");
goto real;}
}
0ºÎÅÍ 10±îÁö ¼ö Áß¿¡ Çϳª¸¦ ¸ÂÃß´Â °Çµ¥¿ä..
ÇØº¸´Ï±ñ ¼ö½Ê¹ø ÇØ¾ß Çѹø ¸ÂÃß´øµ¥
Äڵ尡 ÀÌ»óÇѰǰ¡¿ä ¾Æ´Ô ±×³É ¿ì¿¬Àΰǰ¡¿ä? |
Hit : 8702 Date : 2015/01/14 12:06
|