c语言puse函数 c语言purchar( 四 )


break ;
}
if(i4r==mr){
rnum++;
printf(" %c\n",251);
}
else {
wnum++;
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);
}
}
break;
case '2':
for(j=0;j5;j++){
get_ti(ti,'2');
tinum++;
r=ti.a-ti.b;
for(i=1;i4;i++){
if(i==1)
printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'-',ti.b);
else
printf("\n%4d. %2d%c%2d=",i,ti.a,'-',ti.b);
if(getans(ans)){
flag1=1;
break;
}
mr=atoi(ans);
if(r==mr)
break ;
else
printf(" %c\n",'X');
}
if(flag1){
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);
tinum--;
break ;
}
if(i4r==mr){
rnum++;
printf(" %c\n",251);
}
else {
wnum++;
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'-',ti.b,r);
}
}
break;
case '3':
for(j=0;j5;j++){
get_ti(ti,'3');
tinum++;
r=ti.a*ti.b;
for(i=1;i4;i++){
if(i==1)
printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'*',ti.b);
else
printf("\n%4d. %2d%c%2d=",i,ti.a,'*',ti.b);
if(getans(ans)){
flag1=1;
break;
}
mr=atoi(ans);
if(r==mr)
break ;
else
printf(" %c\n",'X');
}
if(flag1){
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);
tinum--;
break ;
}
if(i4r==mr){
rnum++;
printf(" %c\n",251);
}
else {
wnum++;
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'*',ti.b,r);
}
}
break;
case '4':
for(j=0;j5;j++){
get_ti(ti,'4');
tinum++;
r=ti.a/ti.b;
for(i=1;i4;i++){
if(i==1)
printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'/',ti.b);
else
printf("\n%4d. %2d%c%2d=",i,ti.a,'/',ti.b);
if(getans(ans)){
flag1=1;
break;
}
mr=atoi(ans);
if(r==mr)
break ;
else
printf(" %c\n",'X');
}
if(flag1){
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);
tinum--;
break ;
}
if(i4r==mr){
rnum++;
printf(" %c\n",251);
}
else {
wnum++;
printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'/',ti.b,r);
}
}
break;
case '5':
break;
case 27:
printf("\n\nTotal %2d TiMu.",tinum);
if(tinum){
printf("\nRight %2d ti.",rnum);
rate=(float)rnum/tinum;
printf("\nRight rate %.2f%",rate*100);
}
flag=1;
}
/*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*/
if(flag) {
flag=0;
break;
}
}
/*------------------------------*/
break;
/*****************************/
case '2':
tinum=0;
rnum=0;
wnum=0;
flag=0;
for(i=0;iN;i++){
m2=rand()%4+49;
switch (m2){
/*111111111111111111111111*/
case '1':
get_ti(test_ti[i],'1');
r=test_ti[i].a+test_ti[i].b;
test_ti[i].rr=r;
printf("\n%2d%c%2d=",test_ti[i].a,'+',test_ti[i].b);
if(getans(ans)){
flag=1;
break;
}
mr=atoi(ans);
test_ti[i].mr=mr;
if(r==mr){
rnum++;
tinum+=10;
}
else
wnum++;
break;
/*222222222222222222222222*/
case '2':
get_ti(test_ti[i],'2');
r=test_ti[i].a-test_ti[i].b;
test_ti[i].rr=r;
printf("\n%2d%c%2d=",test_ti[i].a,'-',test_ti[i].b);
if(getans(ans)){
flag=1;
break;
}
mr=atoi(ans);
test_ti[i].mr=mr;
if(r==mr){
rnum++;
tinum+=10;
}
else
wnum++;
break;
/*333333333333333333333333333*/
case '3':
get_ti(test_ti[i],'3');
r=test_ti[i].a*test_ti[i].b;
test_ti[i].rr=r;
printf("\n%2d%c%2d=",test_ti[i].a,'*',test_ti[i].b);
if(getans(ans)){

推荐阅读