starwing能否告诉我那个欧拉定理?
#include<stdio.h> #include<stdlib.h> char op[]="+-*/",*right[]={"你真聪明!","继续保持!","加油!"},*wrong[]={"再想一想,你还有两次机会。","不要着急,要把握住最后一次机会喔!","要加强练习喔!"};int Calc(int* n1,int pn,int* n2){switch (op[pn]){case '+':return *n1 + *n2;case '-':return *n1 - *n2;case '*':return *n1 * *n2;case '/':*n2=rand()%10;*n1=*n2*(rand()%10+1);return *n1 / *n2;}return 0;}int InputNum(){int n;while (scanf("%d",&n) != 1){while (getchar()!='\n');puts("对不起,请重新输入!");}while (getchar()!='\n');return n;}int Practise(int pn){int n1=rand()%100+1,n2=rand()%100+1,ans=Calc(&n1,pn,&n2),i;for(printf("%d %c %d = ?\n",n1,op[pn],n2),i=0;i<3 && InputNum()!=ans;i++)printf("不正确,%s\n",wrong[i]);if(i==3)printf("正确答案是%d.\n",ans);else printf("正确,%s\n",right[i]);printf("是否继续练习?(Y/N)");return getchar()=='y';}int main(n){while(system("cls"),printf("***************************************************\n 小学生四则运算练习系统\n***************************************************\n 1--加法练习\n 2--减法练习\n 3--乘法练习\n 4--除法练习\n 0--退出\n请选择(0--4):"),(n=getchar())!='0')if(n>='1' && n<='4')while(Practise(n-'1'));return 0;}
#include<stdio.h> #include<stdlib.h> char op[]="+-*/",*right[]={"你真聪明!","继续保持!","加油!"},*wrong[]={"再想一想,你还有两次机会。","不要着急,要把握住最后一次机会喔!","要加强练习喔!"};int Calc(int* n1,int pn,int* n2){switch (op[pn]){case '+':return *n1 + *n2;case '-':return *n1 - *n2;case '*':return *n1 * *n2;case '/':*n2=rand()%10;*n1=*n2*(rand()%10+1);return *n1 / *n2;}return 0;}int InputNum(){int n;while (scanf("%d",&n) != 1){while (getchar()!='\n');puts("对不起,请重新输入!");}while (getchar()!='\n');return n;}int Practise(int pn){int n1=rand()%100+1,n2=rand()%100+1,ans=Calc(&n1,pn,&n2),i;for(printf("%d %c %d = ?\n",n1,op[pn],n2),i=0;i<3 && InputNum()!=ans;i++)printf("不正确,%s\n",wrong[i]);if(i==3)printf("正确答案是%d.\n",ans);else printf("正确,%s\n",right[i]);printf("是否继续练习?(Y/N)");return getchar()=='y';}int main(n){while(system("cls"),printf("***************************************************\n%11c小学生四则运算练习系统\n***************************************************\n%15c1--加法练习\n%15c2--减法练习\n%15c3--乘法练习\n%15c4--除法练习\n%15c0--退出\n请选择(0--4):",' ',' ',' ',' ',' ',' '),(n=getchar())!='0')if(n>='1' && n<='4')while(Practise(n-'1'));return 0;}