//
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char* argv[])
{
int u;
int count;
int n;
srand((unsigned)time(NULL));
u=1+rand()%10;
printf("系統產生了壹個1~10之間的整數,猜猜它是幾?\n");
printf("請輸入壹個1~10之間的整數:");
for(int i=0;i<10;i++)
{
scanf("%d",&n);
if(n>u)
printf("輸入妳輸入的數大了,再猜:");
count++;
if(n<u)
printf("輸入妳輸入的數小了,再猜:");
count++;
if(n==u)
{
if(count<=4)
{
printf("恭喜妳,猜對了!妳真牛");
break;
}
if(count>4&&count<=6)
{
printf("猜對了!只是次數有點多哈哈");
break;
}
if(count>6)
{
printf("笨笨,這麽多次才猜對");
break;
}
}
}
return 0;
}