You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
|
|
|
|
|
void test01()
|
|
|
|
|
{
|
|
|
|
|
int num = 0;
|
|
|
|
|
while (num < 10)
|
|
|
|
|
{
|
|
|
|
|
printf("num=%d\n", num);
|
|
|
|
|
num++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void test02()
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
srand((unsigned int)time(NULL));//<2F>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//int i = 0;
|
|
|
|
|
//while (i < 10)
|
|
|
|
|
//{
|
|
|
|
|
// int num=rand() % 100 + 1;//rand()<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>rand<6E><64>100ȡ<30><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-99<39><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ټ<EFBFBD>1<EFBFBD>ͳ<EFBFBD>0-100
|
|
|
|
|
// printf("%d\n",num);
|
|
|
|
|
// i++;
|
|
|
|
|
//}
|
|
|
|
|
int num = rand() % 1000 + 1;
|
|
|
|
|
int val = 0;
|
|
|
|
|
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>1000<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
while (1) //()<29>е<EFBFBD>1Ϊ<31><CEAA>,<2C><><EFBFBD>Ի<EFBFBD>һֱѭ<D6B1><D1AD>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
scanf("%d", &val);
|
|
|
|
|
|
|
|
|
|
if (val > num)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
else if (val < num)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>\n");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ϲ<EFBFBD><EFBFBD>,<2C>¶<EFBFBD><C2B6><EFBFBD>!\n");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
test02();
|
|
|
|
|
|
|
|
|
|
system("pause");
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|