惭愧了。。。。。。。。。
#include <stdio.h>
#include <stdlib.h>
char g;
void fun()
{int i,a,b,c=0,s=0;
for(i=1;i<=10;i++)
{
do{a=rand()%181+20;b=rand()%8+2;}
while(a%b);
printf("%d/%d=\n",a,b);
scanf("%d",&c);
if(c==a/b){printf("right answer!\n");s++;}
else printf("error answer!\n");
}
printf("score=%d\n",10*s);
printf("once again?(y/n)\n");
scanf("%d",&g);
g=getchar();
//return g;
}
void main(void)
{
fun();
while(1)
{
if(g!='n')
fun();
else break;
}
}