commit 285227ac3fc424d235a93b5f5cec1a2edc19a28b Author: 359673683@qq.com <359673683@qq.com> Date: Fri Jan 11 09:52:10 2019 +0800 first commit diff --git a/小学生测验.c b/小学生测验.c new file mode 100644 index 0000000..fca2e55 --- /dev/null +++ b/小学生测验.c @@ -0,0 +1,250 @@ +#include + +#include + +#include + +//ϰṹ + +struct test{ + + char fuhao; + + int a; //һ߼ + + int b; //һ߼ + + int rezult; //ֻ֮ + +}qst[10]; //10Ŀquestion + +void jiemian(); // + +void xitong(); //ϵͳĿ + +int dati(); //ѧģ + +void pingjia(); // + +int main() +{ + jiemian(); + + xitong(); + + pingjia(); + + return 0; +} + +// + +void jiemian() +{ + int kind; //Ƿʼ + + printf("˲Сѧ12꼶\n"); + + printf("-----------------------------\n"); + + printf("׼밴 1 ʼ\n"); + + printf("-----------------------------\n"); + + scanf("%d",&kind); + + while(kind!=1) + { + + printf("1\n"); + + scanf("%d",&kind); + + } + + printf("ϵͳԶĿ\n"); + + printf("-----------------------------\n"); + + printf("ף!\n"); + + printf("-----------------------------\n"); + + printf("ڿʼ\n"); + + printf("---------------------\n"); +} + +//ϵͳĿ + +void xitong() +{ + + int a; //aΪһжӷǼ + + int b,c; //b,cΪ + + int i; // + + srand(time(NULL)); + + for(i=0;i<10;i++){ + + a=rand(); + + b=rand()%51; + + c=rand()%51; + + if(a%2==0) + { + + qst[i].fuhao='+'; + + while(b+c>50) + { + b=rand()%51; //ж֮Ƿ񳬸 + + c=rand()%51; + } + + } + else + { + qst[i].fuhao='-'; + + if(b0) + { + + printf("ź\n"); + + count--; + + if(count==0) + + break; + printf("㻹%dλ\n",count); + + printf("Ĵ: "); + + scanf("%d",&stuanswer); + + } + switch(count) + { + + case 0: + + printf("źûеõ\n"); + + printf("ȷΪ %d\n",qst[i].rezult); break; + + case 1: + + printf("õķΪ5\n"); grade+=5; break; + + case 2: + + printf("õķΪ7\n"); grade+=7; break; + + case 3: + + printf("õķΪ10\n"); grade+=10; break; + + } + printf("ĿǰܷΪ%d\n\n",grade); + + count=3; //ü + } + + return grade; //ճɼж + +} + +// + +void pingjia() +{ + int grade; + + grade=dati(); + + printf("ܷΪ%d\n",grade); + + printf("յۣ\n"); + + grade/=10; + + switch(grade){ + + case(10): + + case(9): + + printf("SMART\n"); break; + + case(8): + + printf("GOOD\n"); break; + + case(7): + + printf("OK\n"); break; + + case(6): + + printf("PASS\n"); break; + + default: + + printf("TRY AGAIN\n"); break; + + } +} diff --git a/小学生测验.exe b/小学生测验.exe new file mode 100644 index 0000000..36f02c8 Binary files /dev/null and b/小学生测验.exe differ