system("pause");为什么失灵求大神帮忙
#include<stdio.h>#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<ctype.h>
#include<windows.h>
#include <conio.h>
#include<time.h>
int main()
{
char ID[7];
srand(time(NULL));
int validation=0;
int judge(char []);
int select,i,yunsuan,ysy1,ysy2,result,ans,zq,cw;
zq=0;
cw=0;
while(validation==0)
{
printf("请输入您的ID号码");
scanf("%s",&ID);
validation=judge(ID);
if(validation==0)
{
printf("无效的ID号码\n");
}
}
printf("输入1开始测试\n");
printf("输入2查看历史成绩\n");
printf("输入3退出\n");
scanf("%d",&select);
switch(select)
{
case 1:
for (i=1;i<=10;i++)//进行十次运算
{
yunsuan=1+rand()%4;//随机选择运算类型
switch(yunsuan)
{
case 1://加法
ysy1=100;
ysy2=100;
while(ysy1+ysy2>100)
{
ysy1=0+rand()%101;
ysy2=0+rand()%101;
}
result=ysy1+ysy2;
printf("%d+%d=",ysy1,ysy2);
scanf("%d",ans);
if(ans==result)
zq++;
else
cw++;
break;
case 2://减法
ysy1=1;
ysy2=100;
while((ysy1<ysy2)||(ysy1-ysy2>100))
{
ysy1=0+rand()%101;
ysy2=0+rand()%101;
}
result=ysy1-ysy2;
printf("%d-%d=",ysy1,ysy2);
scanf("%d",ans);
if(ans==result)
zq++;
else
cw++;
break;
case 3://乘法
ysy1=100;
ysy2=100;
while(ysy1*ysy2>100)
{
ysy1=0+rand()%101;
ysy2=0+rand()%101;
}
result=ysy1*ysy2;
printf("%d*%d=",ysy1,ysy2);
scanf("%d",ans);
if(ans==result)
zq++;
else
cw++;
break;
case 4://除法
ysy1=1000;
ysy2=3;
while((ysy1/ysy2>100)||(ysy1%ysy2!=0))
{
ysy1=1+rand()%100;
ysy2=1+rand()%100;
}
result=ysy1/ysy2;
printf("%d/%d=",ysy1,ysy2);
scanf("%d",ans);
if(ans==result)
zq++;
else
cw++;
}//switch结束
}//循环结束
break;
//case 2:;break;
//case 3:;break;
//default:break;
}//switch结束
printf("hi");
system("pause");
return 0;
}//main结束
int judge(char a[7])
{
int b;
if((a[0]>=65)&&(a[0]<=90)&&(a[1]>=65)&&(a[1]<=90)&&(a[6]=='\0'))
b=1;
else
b=0;
return b;
}