diff --git a/main(改进版).c b/main(改进版).c new file mode 100644 index 0000000..7b931c6 --- /dev/null +++ b/main(改进版).c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +void main() +{ + srand(time(NULL)); + int num=0,add=0; /* ´ðÌâÊý£¬×Ü·Ö */ + int score[3]={10,7,5};/*µÃ¼¸·Ö*/ + char str[20],str1[10][20]; + + while(1) + { + int a=0,b=0,d=0,c=0,k=0,i=0,j=-1,result; + char sf[2]={'+','-'};/* ·ûºÅ */ + while(1) + { + a=rand()%51;/*0-50µÄËæ»úÊý*/ + b=rand()%51;/*0-50µÄËæ»úÊý*/ + d=rand()%2;/* Ëæ»ú·ûºÅ */ + if(d==0)c=a+b; + else c=a-b; + if(c>=0 && c<=50)/* Èç¹ûÏàͬÖØгöÌâ */ + { + sprintf(str,"%d %c %d = \n",a,sf[d],b); + strcpy(str1[num],str); + if(num==0) break; + j=-1; + for(i=0; i=90)printf("\nSMART\n"); + else if(add>=80)printf("\nGOOD\n"); + else if(add>=70)printf("\nOK\n"); + else if(add>=60)printf("\nPASS\n"); + else printf("\nTRY AGAIN\n"); +getch(); +} + diff --git a/main(改进版).exe b/main(改进版).exe new file mode 100644 index 0000000..8619293 Binary files /dev/null and b/main(改进版).exe differ