简单的小学生试卷组卷系统 您所在的位置:网站首页 组卷系统源码 简单的小学生试卷组卷系统

简单的小学生试卷组卷系统

2023-10-06 04:10| 来源: 网络整理| 查看: 265

今天高中同学叫我帮他写期末任务书的代码,写了一个关于试卷组卷系统的简单代码,这个函数主要是为了给C语言重修的兄弟应付的,所以只写了核心代码,交互界面以及美化都交给他自己,中间使用了goto语句,算是一个小瑕疵。

从构思到写完用了不到1小时,算是一个满意的过程。

#include #include #include #include void main() { int a = 0; int b = 0; int mode = 0; int c = 0; int result = 0; int score = 0; int i = 0; srand((unsigned)time(NULL));//调用随机 for (i = 0; i < 10; i++) { int g = 1; there: a = rand() % 50; b = rand() % 50; mode = rand() % 1; switch (mode) { case 0: result = a + b; if (result > 50) goto there;//检验result的值 else break; case 1: result = a - b; if (result < 0) goto there; else break; } for (g = 1; g =90)//分等级 { printf("SMART"); } else if (score >= 80) { printf("GOOD"); } else if (score >= 70) { printf("OK"); } else if (score >= 60) { printf("PASS"); } else if (score < 60) { printf("TRY AGAIN"); } getchar(); getchar(); getchar(); }


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有