【vc++精品源码栏目提醒】:网学会员,鉴于大家对vc++精品源码十分关注,论文会员在此为大家搜集整理了“C语言版数学测试软件 - 其它资料”一文,供大家参考学习!
本程序由 www.udoless.com 提供该软件是一个供 2 年级小学生进行数学测验用的测试软件,并能够给出测试结果。
可以设置出题数量、难度、是否开启时间限制、背景颜色、字体颜色等等等…可以进行注册,注册后测试会记录成绩,并可以查看个人测试记录,也可以看自己的排名,以及大家的测试情况,排名可以根据时间、分数二种排法!!功能强大的没话说!后面是源码,在 VC6.0 下完美运行,运行时只需要一个文件即可,会自动创建几个文本文件用于记录record.txt 记录所有人得测试成绩、user.txt 记录用户注册信息、config.txt 程序配置信息、temp.txt 测试时用的临时文件注意:后台管理初始密码为:123456下面简单晒几张图,includeincludeincludeincludechar pass20123456int titleNum10 //测试题目数int level2 //测试难度等级0123int type0 //测试算术类型01234 分别为:混合,-/int timeLimit0 //测试是否有时间限制,0 为没有,非 0 则为秒char color1017 //程序配色void mainMenuchar userNameFILE ffpvoid getTipsfloat scorevoid getTimevoid getTimeByTimeInfostruct tm timeinfovoid testNoticeint getTestFILE tfpvoid savestruct personFILE ffpvoid testchar userName20FILE ffpvoid my_recordchar userNameFILE ffpvoid rankchar userName20int typeFILE ffpvoid free_testchar userName20FILE ffpvoid regFILE ufpFILE ffpvoid loginchar userNameFILE ufpFILE ffpvoid showRankchar userName20FILE ffpvoid mainMenuchar userNameFILE ffpvoid setchar userName20FILE ffpvoid setMenustruct setstruct person char name20 float score float rate struct tm timeinfo //不要把结构体放在最下面,不然会使 person 结构体大小变化,影响结果 double timestruct set int titleNum int level //测试难度等级0123 int type //测试算术类型01234 分别为:混合,-/ int timeLimit //测试是否有时间限制,0 为没有,非 0 则为秒 char color10 //程序配色main FILE ffpufpsfp char userName20sys30color int Len struct set s ffpfopenrecord.txta ufpfopenuser.txta sfpfopenconfig.txta Lensizeofstruct set if freadsLen1sfp0 titleNums.titleNum levels.level types.type timeLimits.timeLimit strcpycolors.color else s.titleNumtitleNum s.levellevel s.typetype s.timeLimittimeLimit strcpys.colorcolor fwritesLen1sfp sprintfsyscolor scolor systemsys fclosesfp printf登录输 0 注册n //开始界面 printf用户名: scanfsuserName if strcmpuserName00 regufpffp else loginuserNameufpffp fcloseffp //close file fcloseufp/ 根据测试得分给出评价 /void getTipsfloat score printf小贴士: if score30 score50 score60 score90 printf做的太棒了nstruct tm getTimeInfo time_t rawtime struct tm timeinfo time rawtime timeinfo localtime rawtime return timeinfo/ 取得当前时间(eg:2012-12-10 21:29:28)有回车 /void getTime time_t rawtime struct tm timeinfo time rawtime timeinfo localtime rawtime printf 4d-02d-02d 02d:02d:02dn1900timeinfo-tm_year1timeinfo-tm_montimeinfo-tm_mdaytimeinfo-tm_hourtimeinfo-tm_mintimeinfo-tm_sec/ 根据时间信息结构体输出时间(eg:2012-12-10 21:29:28)有回车 /void getTimeByTimeInfostruct tm timeinfo printf 4d-02d-02d 02d:02d:02dn1900timeinfo-tm_year1timeinfo-tm_montimeinfo-tm_mdaytimeinfo-tm_hourtimeinfo-tm_mintimeinfo-tm_sec/ 开始测试先显示的测试须知 /void testNotice//本程序由 www.udoless.com 提供 printf测试须知n printf考试时会记录考试时间n printf超出时间限制,则进行强制交卷但不计成绩n printf考试结束后就可以马上看到正确答案、