commit 2cc395efca77335865dc93f901070ec90503079d Author: 18408200211@stu.hut.edu.cn <18408200211@stu.hut.edu.cn> Date: Sun Jan 6 22:54:52 2019 +0800 first commit diff --git a/用文件录入题目,插入题目.cpp b/用文件录入题目,插入题目.cpp new file mode 100644 index 0000000..8352c86 --- /dev/null +++ b/用文件录入题目,插入题目.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#define TRUE 1 +#define ERROR 0 +#define MAX 30 +typedef int Status; +typedef struct{ + char option1[30],option2[30],option3[30],option4[30],subject[150]; + char result; +}TestNode; +TestNode Testquestions[MAX]; + +Staus SaveNode(int N) //ѽṹ鱣浽ļѡ⿼⡱ +{ + int i; + FILE *fp; + if((fp=fopen("ѡ⿼","wb"))==NULL) + return ERROR; + for(i=0;iMAX) + return ERROR; + printf("ҪĿɺѡ\n"); + printf("Ŀ"); + gets(Testquestions[N].subject); + printf("ѡA"); + gets(Testquestion[N].option1); + printf("ѡB"); + gets(Testquestion[N].option2); + printf("ѡC"); + gets(Testquestion[N].option3); + printf("ѡD"); + gets(Testquestion[N].option4); + printf("𰸣"); + scanf(%c,&Teatquestion[N].result); + getchar(); + N++; + return TURE; + }