为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > C语言课程设计(单项选择题标准化考试系统)报告

C语言课程设计(单项选择题标准化考试系统)报告

2023-06-13 6页 pdf 557KB 3阅读

用户头像 个人认证

is_017931

热爱锻炼

举报
C语言课程设计(单项选择题标准化考试系统)报告重庆理工大学课程设计课程程序设计基础C题目C语言综合程序设计院系名称班级学生姓名学号指导教师评阅教师时间2011.611423NN4522.141.Main2.mC:\test.txtmm-13.4.C:\test.txt2.2(1)123(2)1234(3)102345(4)12342.31.2.3.4.2.4fgetc()fseek()33.1#include#include#defineLENsizeof(structtest)structtest{charque[81];charanswer1[81];charansw...
C语言课程设计(单项选择题标准化考试系统)报告
重庆理工大学课程设计课程程序设计基础C题目C语言综合程序设计院系名称班级学生姓名学号指导教师评阅教师时间2011.611423NN4522.141.Main2.mC:\test.txtmm-13.4.C:\test.txt2.2(1)123(2)1234(3)102345(4)12342.31.2.3.4.2.4fgetc()fseek()33.1#include#include#defineLENsizeof(structtest)structtest{charque[81];charanswer1[81];charanswer2[81];charanswer3[81];charanswer4[81];charture;structtest*next;};structtest*head;//intzts(intm)//m-1{FILE*fp;structtest*p1=NULL;charch,ch1[5];inti,n=0,wz,py;if((fp=fopen("c:\\test.txt","r"))==NULL)//{printf("Ctest.txt\n");exit(0);}dopy=1;{ch=fgetc(fp);for(i=0;ch!='\n'&&ch!=-1;i++)//{py++;ch=fgetc(fp);}n++;//if(n==m)//{if(p1==NULL)//{p1=(structtest*)malloc(LEN);head=p1;p1->next=NULL;}else{p1->next=p1;p1=(structtest*)malloc(LEN);p1->next=NULL;}wz=ftell(fp);//fseek(fp,(wz-py-1),0);//fscanf(fp,"%s%s%s%s%s%s",&p1->que,&p1->answer1,&p1->answer2,&p1->answer3,&p1->answer4,&ch1);fseek(fp,wz+1,0);//p1->ture=ch1[0];break;//}}while(!feof(fp));//fclose(fp);returnn;//n}voidexe1()voidmain();voidexe2();intn,m=0,tm,i,t=0,f=0;charans[2];structtest*p1;system("cls");printf("");scanf("%d",&n);tm=zts(-1);if(0>n||n>tm){printf("!");exe1();}for(i=0;ique,p1->answer1,p1->answer2,p1->answer3,p1->answer4);scanf("%s",&ans);if(toupper(ans[0])==p1->ture)//{printf("\n\n");t++;//}else{printf("\n%c\n\n",p1->ture);f++;//}}p1=head;do{head=p1->next;free(p1);p1=head;}while(p1!=NULL);//printf("*******************************\n");printf("\n!\n%d%d%d\n%5.2f%%\n\n",n,f,t,(float)t/n*100);printf("*******************************\n");printf("\n\n1.2.3.\n");i=0;scanf("%d",&i);if(i==1)exe1();//elseif(i==2)exe2();//elsemain();//}voidexe2()//{voidmain();system("cls");intn;FILE*fp;if((fp=fopen("c:\\test.txt","a"))==NULL){printf("Ctest.txt\n");exit(0);}structtest*p1=NULL;p1=(structtest*)malloc(LEN);//do{printf("");scanf("%s",&p1->que);}while(p1->que[0]=='\0');do{printf("A");scanf("%s",&p1->answer1);}while(p1->answer1=='\0');do{printf("B");scanf("%s",&p1->answer2);}while(p1->answer2=='\0');do{printf("C");scanf("%s",&p1->answer3);}while(p1->answer3=='\0');do{printf("D");scanf("%s",&p1->answer4);}while(p1->answer4=='\0');printf("");doscanf("%c",&p1->ture);{p1->ture=toupper(p1->ture);}while(p1->ture!='A'&&p1->ture!='B'&&p1->ture!='C'&&p1->ture!='D');printf("\n\n1.2.\n");scanf("%d",&n);if(n==1){fputc('\n',fp);fputs(p1->que,fp);fputc('',fp);fputs("A.",fp);fputs(p1->answer1,fp);fputc('',fp);fputs("B.",fp);fputs(p1->answer2,fp);fputc('',fp);fputs("C.",fp);fputs(p1->answer3,fp);fputc('',fp);fputs("D.",fp);fputs(p1->answer4,fp);fputc('',fp);fputc(p1->ture,fp);fclose(fp);printf("!");system("cls");free(p1);printf("\n1.2.\n");scanf("%d",&n);if(n==1)exe2();elsemain();else}free(p1);exe2();voidmain(){system("cls");intn;printf("**\n");printf("\n");printf("**\n");printf("\t1.\n");printf("\t2.\n");printf("\t3.\n");printf("\n");scanf("%d",&n);switch(n){case1:exe1();break;case2:exe2();break;case3:printf("\n^-^,goodbye!\n");}while(n!=3);}44.11.3C:\test.txt2.4.2123451.2.
/
本文档为【C语言课程设计(单项选择题标准化考试系统)报告】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索