标签:
#include<stdio.h> #include<stdlib.h> #include<time.h> int main() { printf("请输入数字:\n"); srand(time(0)); int a,n,i; a=rand()%100; scanf("%d",&n); for(i=1;i<=10;i++) { if(a==n) { printf("bingo!"); break; } else if(a>n) { printf("too small!"); scanf("%d",&n); } else { printf("too big!"); scanf("%d",&n); } } return 0; }
标签:
原文地址:http://www.cnblogs.com/gaosimeng0627/p/5944295.html