Data structure Skill examination system

Source: Internet
Author: User
Tags fread strcmp

Tag: price min input time Ror interface int case return

Through one months of efforts, finally the data structure skills test system in C + + language implementation (which has the C language interspersed), the system's greatest advantage is that students can detect whether the answer is inserted in the U disk, opened word and notepad and other auxiliary tools. This system is divided into two parts, part of the student-side, part of the teacher-side.

Students are mainly students enter the number and name (to detect this), according to the number of the last four bits corresponding to the ASCII code modulo 8 evaluation, To achieve the effect of the problem (can also be appropriately improved to IP reading), in the bank to take two questions, random answer a question can be completed after the answer to choose the test, to avoid the topic will not do after the situation. Draw the countdown, the time is 60 minutes, if the timeout, the maximum allowable period of 20 minutes, after the end of the answer can automatically send the program and encrypted student information to the teacher side.

The teacher's function is to obtain the student's file, open its CPP and information file in turn, enter the result, and finally generate the student achievement form. Reduce the need to go to the students to see the program, record the trouble of performance.

Some of the system considerations are as follows:

    1. Need to put the file in the D-drive data structure Skills Exam folder, the folder contains a folder named Ti and xuehao,xingming txt text, ti folder put questions, named format for 1.txt,2.txt, Xuehao put the student's school number, Name put the student's name.
    2. The student-generated CPP file needs to be opened manually, and if the period is reopened, the countdown starts again.
    3. If a USB flash drive is detected by the student, Word will block the problem if it is turned on, and the exam will be valid.
    4. The teacher side needs to put the data structure of the D-Disk into the new candidate information file in the test folder and change it to shared mode.
    5. The number of students each read by the teacher once fixed, the system will read the corresponding number from beginning to end, regardless of the upload time.

Student side:

#include <stdio.h> #include <stdlib.h> #include <iostream> #include <math.h> #include < time.h> #include <string.h> #include <fstream> #include <conio.h> #include <windows.h># Define Normal_siz bufsiz #define Chmsk_key 0xa5char Buf[normal_siz];          Using namespace std;//Displays the question contents on the screen int duquwenben (string a) {FILE *fp;          Fp=fopen (A.c_str (), "R");          Char buf[1024];          while ((Fgets (BUF,1024,FP))!=null) {printf ("%s", buf);  } printf ("\ n"); return 0;}  Read drive status int getdriverinfo (LPSTR szdrive) {UINT udrivertype;   Udrivertype = GetDriveType (szdrive);  if (udrivertype==drive_removable) return 1;                                                                                           else return 0; }//determine if there is a USB stick inserted int checkudisk () {CHAR szlogicdrivestrings[1024]; PCHAR szdrive; GetLogicalDriveStrings (1023,szlogicdrivestrings);   Szdrive = (PCHAR) szlogicdrivestrings;  for (int i=0;i<7;i++) { if (Getdriverinfo (szdrive)) return 1;szdrive + = (lstrlen (szdrive) +1); } return 0;} Determines whether to open word,ppt and Notepad int checktask () {string temp1,temp2,temp3;temp1= "tasklist | find"; temp2=temp1+ "\" winword\ "" + " > 1.txt "; System (TEMP2.C_STR ()); temp2=temp1+" \ "powerpnt\" "+" >> 1.txt "; System (TEMP2.C_STR ()); temp2=temp1+ "\" note\ "" + ">> 1.txt"; System (TEMP2.C_STR ()); Ifstream Test;test.open ("1.txt"); while (!test.eof ()) {test> >temp3;if (Temp3.length () >3) {return 1; break;}} Test.close (); return 0;} Store the student's relevant content in the Xinxi text document void Xinxi () {FILE *fp=fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "w+"); fprintf (FP, "%s", "d:\\ data structure Skills test \ "); fclose (FP);} Login interface and determine if the information is compliant with void Denglu1 (char b[]) {FILE *fp=fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "w+"); FILE *fq=fopen ("d:\\ Data structure Skill Test \\xingming.txt", "R"); char m[4],ch,s[100];int i=0,k=0,n,x=0,y,len;//m1[0]= ' \ n ';p rintf ( "Please enter name:"); for (int v=0;v<3&&k==0;v++) {gets (b); fclose (FQ); FILE *fq=fopen ("d:\\ Data structure Skills Test \\xingming.txt", "R"); while (fgets (S,100,FQ) = NULL) {len = strlen (s); s[Len-1] = ' + '; if (strcmp (b,s) ==0) {fputs (B,FP); k=1; break;}} if (k==0&&v<2) printf ("Please Reenter:");} Fclose (FP); fclose (FQ), if (k==0) exit (0); Log in to the number interface and determine if the information void Denglu2 (char c[]) {FILE *fp=fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "A +") is met; FILE *fq=fopen ("d:\\ Data structure Skill Test \\xuehao.txt", "R"), Char m[4],ch,s[100];int i=0,k=0,n,x=0,y,len;printf ("Enter study number:"); for ( int v=0;v<3&&k==0;v++) {gets (c); fclose (FQ); FILE *fq=fopen ("d:\\ Data structure Skills Test \\xuehao.txt", "R"); while (fgets (S,100,FQ) = NULL) {len = strlen (s); s[len-1] = ' + '; if (strcmp (c,s) ==0) {fprintf (FP, "\ n"); fputs (C,FP); k=1; Break }}if (k==0&&v<2) printf ("Please Reenter:");} Fclose (FP); fclose (FQ), if (k==0) exit (0); According to the student's number draw the question int chuti (int a) {int b;a=a%8;b=a+10;    FILE *fp=fopen ("d:\\ Data structure Skills Test \\xinxi.txt", "A +"); Stringtempidd;string tempid= "d:\\ Data structure Skills Test \\Ti\\1.txt"; fprintf (FP, "\ n"), fprintf (FP, "%s", "student-drawn Question:");p rintf ("\ n the questions to be drawn are:%d and%d \ n ", a+1,b+1); fprintf (FP,"%s "," P "), fprintf (FP,"%d ", a+1), fprintf (FP,"%s "," Title and section "), fprintf (FP,"%d " , b+1); fprintf (FP, "%s",fprintf (FP, "\ n"), switch (a) {case 0:tempid= "d:\\ data structure Skills Test \\Ti\\1.txt"; break;case 1:tempid= "d:\\ Data structure Skills exam \\Ti\\ 2.txt "; break;case 2:tempid=" d:\\ Data structure Skills Test \\Ti\\3.txt "Break;case 3:tempid=" d:\\ Data structure Skills Test \\Ti\\4.txt "; Break;case 4: tempid= "d:\\ Data structure skill examination \\Ti\\5.txt"; break;case 5:tempid= "d:\\ data structure Skill Test \\Ti\\6.txt" Break;case 6:tempid= "d:\\ Data structure skill test \\Ti\\7.txt "; break;case 7:tempid=" d:\\ Data structure Skill examination \\Ti\\8.txt "Break;case 8:tempid=" d:\\ Data structure Skills Test \\Ti\\9.txt "; Case 9:tempid= "d:\\ data structure Skills Test \\Ti\\10.txt"; break;case 10:tempid= "d:\\ Data structure Skills Test \\Ti\\11.txt"; Break;case 11:tempid= "D : \ \ Data Structure skill examination \\Ti\\12.txt "; break;case 12:tempid=" d:\\ Data structure Skill examination \\Ti\\13.txt "Break;case 13:tempid=" d:\\ Data structure Skills exam \\Ti\ \14.txt "; break;case 14:tempid=" d:\\ Data structure Skill examination \\Ti\\15.txt "Break;case 15:tempid=" d:\\ Data structure Skills Test \\Ti\\16.txt "; Case 16:tempid= "d:\\ data structure Skills Test \\Ti\\17.txt"; break;case 17:tempid= "d:\\ data structure skill test \\Ti\\18.txt";   Duquwenben (tempid);p rintf ("*********************************************************** \ n"); Switch (b) {case 0:tempidd= "d:\\ Data structure skill examination \\Ti\\1.txt"; break;case 1:tempidd= "d:\\ data structure Skill Test \\Ti\\2.txt" Break;case 2:tempidd= "d:\\ data structure skill exam \ \ Ti\\3.txt "; break;case 3:tempidd=" d:\\ Data structure Skill examination \\Ti\\4.txt "Break;case 4:tempidd=" d:\\ Data structure Skills Test \\Ti\\5.txt "; Case 5:tempidd= "d:\\ data structure Skills Test \\Ti\\6.txt"; break;case 6:tempidd= "d:\\ data structure Skill Test \\Ti\\7.txt" Break;case 7:tempidd= "d:\ \ Data Structure skill examination \\Ti\\8.txt "; break;case 8:tempidd=" d:\\ Data structure Skill examination \\Ti\\9.txt "Break;case 9:tempidd=" d:\\ Data structure Skills test \\TI\\10. TXT "; break;case 10:tempidd=" d:\\ Data structure Skills Test \\Ti\\11.txt "Break;case 11:tempidd=" d:\\ Data structure Skills Test \\Ti\\12.txt "; Case 12:tempidd= "d:\\ data structure Skills Test \\Ti\\13.txt"; break;case 13:tempidd= "d:\\ Data structure Skills Test \\Ti\\14.txt"; Break;case 14:tempidd = "d:\\ data structure skill Test \\Ti\\15.txt"; break;case 15:tempidd= "d:\\ data structure Skill Test \\Ti\\16.txt" Break;case 16:tempidd= "d:\\ Data structure skill test \\Ti\\17.txt "; break;case 17:tempidd=" d:\\ Data structure skill examination \\Ti\\18.txt "; Duquwenben (Tempidd), if (Checkudisk ()) {printf ("No U-disk inserted, please unplug and retry \ n"), while (Checkudisk ()) Sleep (1);} Fclose (FP);//system (f); return 0;} If there is an exception, the problem will be re-displayed int cHongchuti (int a) {int b;a=a%8;b=a+10;string tempid,tempidd;tempid= "d:\\ data structure Skill Test \\Ti\\1.txt";p rintf ("The test is:% Question D and%d \ n ", a+1,b+1); switch (a) {case 0:tempid=" d:\\ data structure Skills Test \\Ti\\1.txt "; break;case 1:tempid=" d:\\ Data structure Skills test \\Ti\\2. TXT "; break;case 2:tempid=" d:\\ Data structure Skills Test \\Ti\\3.txt "Break;case 3:tempid=" d:\\ Data structure Skills Test \\Ti\\4.txt "; Break;case 4: tempid= "d:\\ Data structure skill examination \\Ti\\5.txt"; break;case 5:tempid= "d:\\ data structure Skill Test \\Ti\\6.txt" Break;case 6:tempid= "d:\\ Data structure skill test \\Ti\\7.txt "; break;case 7:tempid=" d:\\ Data structure Skill examination \\Ti\\8.txt "Break;case 8:tempid=" d:\\ Data structure Skills Test \\Ti\\9.txt "; Case 9:tempid= "d:\\ data structure Skills Test \\Ti\\10.txt"; break;case 10:tempid= "d:\\ Data structure Skills Test \\Ti\\11.txt"; Break;case 11:tempid= "D : \ \ Data Structure skill examination \\Ti\\12.txt "; break;case 12:tempid=" d:\\ Data structure Skill examination \\Ti\\13.txt "Break;case 13:tempid=" d:\\ Data structure Skills exam \\Ti\ \14.txt "; break;case 14:tempid=" d:\\ Data structure Skill examination \\Ti\\15.txt "Break;case 15:tempid=" d:\\ Data structure Skills Test \\Ti\\16.txt "; Case 16:tempid= "d:\\ data structure Skills Test \\Ti\\17.txt"; break;case 17:tempid= "d:\\ data structure skill test \\Ti\\18.txt"; Duquwenben (TEMPID);p rintf ("*********************************************************** \ n"); Switch (b) {case 0:tempidd= "d:\\ data structure skill Test \\Ti\\1.txt"; break;case 1:tempidd= "d:\\ Data structure Skills Test \\Ti\\2.txt"; Break;case 2: tempidd= "d:\\ Data structure skill examination \\Ti\\3.txt"; break;case 3:tempidd= "d:\\ data structure Skill Test \\Ti\\4.txt" Break;case 4:tempidd= "d:\\ Data structure skill examination \\Ti\\5.txt "; break;case 5:tempidd=" d:\\ Data structure Skill examination \\Ti\\6.txt "Break;case 6:tempidd=" d:\\ Data structure Skills test \\Ti\\7. TXT "; break;case 7:tempidd=" d:\\ Data structure Skills Test \\Ti\\8.txt "Break;case 8:tempidd=" d:\\ Data structure Skills Test \\Ti\\9.txt "; Break;case 9: tempidd= "d:\\ Data structure skill examination \\Ti\\10.txt"; break;case 10:tempidd= "d:\\ data structure Skill Test \\Ti\\11.txt" Break;case 11:tempidd= "d:\\ Data structure skill examination \\Ti\\12.txt "; break;case 12:tempidd=" d:\\ Data structure Skill examination \\Ti\\13.txt "Break;case 13:tempidd=" d:\\ Data structure Skills exam \\Ti\\ 14.txt "; break;case 14:tempidd=" d:\\ Data structure Skill examination \\Ti\\15.txt "Break;case 15:tempidd=" d:\\ data structure skill test \\Ti\\16.txt "; break; Case 16:tempidd= "d:\\ data structure Skills Test \\Ti\\17.txt"; break;case 17:tempidd= "d:\\ data structure skill test \\Ti\\18.txt"; Duquwenben (Tempidd); return 0;} Text that generates student informationFile will be encrypted void Jiami () {File *FP = fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "rb+");            int n;                   while ((n = fread (buf, 1, Normal_siz, FP)) > 0) {int i;          for (i = 0; i < n; i++) {buf[i] ^= chmsk_key;          } if (Fseek (FP,-n, seek_cur) = =-1) {perror ("fseek");          } n = fwrite (buf, 1, N, FP);      Fflush (FP);//If this is not the case, then if the file size is smaller than the library function buffer (the default is the Bufsiz size), the actual polygon writes are not written, which results in the next read or success, so the program does not exit buf[0] = 0;  } fclose (FP);    }//countdown time is 1 hours void Daojishi (int a,int m[0],int sec[0]) {m[0]=59,sec[0] = 59;    printf ("\ n"); while (m[0]>=0) {sec[0] = 59;                    while (Sec[0] > 0) {if (_kbhit ()) break;        printf ("\r%2d:%2d", m[0],sec[0]);        Sleep (1000);        sec[0]--; if (sec[0]%10==0) {if (Checkudisk ()) {System ("CLS"), while (Checkudisk ()) {Sleep (1);p rintf ("No U-disk inserted, please unplug and retry \ n"); system ( "CLS");} Chongchuti (a);p rintf ("remaining");} if (Checktask ()) {System ("CLS"), while (Checktask ()) {Sleep (1);p rintf ("Do not use Word, ppt, txt file, please close and re-login \ n"); System ("CLS" );}    Chongchuti (a);p rintf ("Time Remaining");}    } if (_kbhit ()) break;//printf ("***%d\n", m[0]);//printf ("***%d\n", sec[0]); if (m[0]==0&&sec[0]==1) break;m[0]--;}        /* if (sec > 0) {System ("CLS");    Print_jiayou (); } else printf ("\ n timed out!")  "); *///GetChar ();    if (m[0]!=0&&sec[0]!=1) GetChar ();    }//if more than one hour, allow up to 20 minutes timeout void Chaoshi (int a,int m1[0],int sec1[0]) {m1[0]=19,sec1[0] = 59;    printf ("\ n"); while (m1[0]>=0) {sec1[0] = 59;          while (Sec1[0] > 0) {if (_kbhit ()) break;            printf ("\r%2d:%2d", m1[0],sec1[0]);        printf ("Time Out \ n");        Sleep (1000);        sec1[0]--; if (sec1[0]%10==0) {if (Checkudisk ()) {System ("CLS"), while (Checkudisk ()) {Sleep (1);p rintf ("No U-disk inserted, please unplug and retry \ n"); system ("CLS"); Chongchuti (a);p rintf ("Time-out");} if (Checktask ()) {System ("CLS"); wHile (Checktask ()) {Sleep (1);p rintf ("Prohibit use of Word, PPT, txt file, please close and re-login \ n"); System ("CLS");    Chongchuti (a);p rintf ("Time-out");}}    } if (_kbhit ()) break;//printf ("***%d\n", m[0]);//printf ("***%d\n", sec[0]); if (m1[0]==0&&sec1[0]==1) break;m1[0]--;}        /* if (sec > 0) {System ("CLS");    Print_jiayou (); } else printf ("\ n timed out!")  "); *///GetChar (); if (m1[0]!=0&&sec1[0]!=1) GetChar ();} int main () {char a[10000];int b[10],c[2];char d[4],e[14];char g[20];char f[12];char s[25];int n,x=0,l;int m[1],sec[1]; int M1[1],sec1[1];xinxi (); File *fx=fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "r+"), Fgets (F,25,FX), fclose (FX),/* Check if there is a USB flash drive and related file open */if (Checkudisk ()) { printf ("No U-disk inserted, please unplug and retry \ n"); while (Checkudisk ()) Sleep (1);} if (Checktask ()) {printf ("Prohibit use of Word, PPT, txt file, please close and retry \ n"); while (Checktask ()) Sleep (1);} /* Login Interface */System ("CLS");d ENGLU1 (e);d englu2 (d); int mg=d[10]+d[11]+d[12]+d[13];//Get the student's number//generate the student number of the CPP file *fc=fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "r+"); if (CheckudISK ()) {printf ("Prohibit inserting U-disk, unplug and retry \ n"), while (Checkudisk ()) Sleep (1);} Fgets (S,25,FC);/* Use fgets to read the first line to the array s */n=strlen (s), x +=n;fseek (Fc,x+1,seek_set),/* Move the file pointer to the next line */fgets (S,25,FC);/* Use Fgets to read the second line into the array s */for (int v=0;v<15;v++) {f[20+v]=s[v];} F[34]= '. '; F[35]= ' C '; f[36]= ' P '; f[37]= ' P '; f[38]= ' + '; fflush (stdin); FILE *mv=fopen (F, "w+"), fclose (MV), Fclose (FC), if (Checkudisk ()) {printf ("No U-disk inserted, please unplug and retry \ n"); while (Checkudisk ()) Sleep (1);} Chuti (MG);///Draw the question/* Countdown start */printf ("\ nthe test begins, time is 60 minutes, now remaining:");d Aojishi (mg,m,sec); M[0]=59-m[0];sec[0]=59-sec[0];if (m[0]= =0&AMP;&AMP;SEC[0]==58)//If the countdown end has not stopped, automatically record the time-out Chaoshi (MG,M1,SEC1); else{m1[0]=19;sec1[0]=59;} if (sec[0]==59) {m[0]++;sec[0]=0;} M1[0]=19-m1[0];sec1[0]=59-sec1[0];if (sec1[0]==59) {m1[0]++;sec1[0]=0;} Fflush (stdin);//Enter the selected title of FILE *fg=fopen ("d:\\ Data structure Skill Test \\xinxi.txt", "A +");p rintf ("Please enter the selected title:"); scanf ("%d", &l); while (l!=mg%8+1&&l!=mg%8+11) {printf ("Please enter the selected title:"), scanf ("%d", &l);} fprintf (FG, "%s", "Student-selected number is:"), fprintf (FG, "%d", L), fprintf (FG, "\ n"), fprintf (FG, "%s", "student doing the Question Time:"); fprintf(FG, "%d", m[0]); fprintf (FG, "%s", ":"), fprintf (FG, "%d", sec[0]), fprintf (FG, "\ n"), fprintf (FG, "%s", "student-to-title timeout:"); fprintf (FG, "%d", m1[0]); fprintf (FG, "%s", ":"); fprintf (FG, "%d", sec1[0]); fclose (FG);//upload to the classroom side of the LAN string teachip= "\\\ \172.17.1.41\\ examinee Information "; string sss (f); string dosstr2=" copy "+sss+" "+teachip;if (System (DOSSTR2.C_STR ())!=0) {printf (" Upload failed, please manually upload ");p UTS (f); else printf ("Upload succeeded \ n"); f[34]= '.; f[35]= ' t '; f[36]= ' x '; f[37]= ' t '; f[38]= ' + '; Jiami ();//Generate Student information files and encrypt rename ("D:\\ Data structure Skills Test \\xinxi.txt", f); Fclose (FC); String ddd (f); string dosstr= "copy" +ddd+ "" +teachip;if (System (DOSSTR.C_STR ())!=0) {//upload failed, prompt for manual upload and file location printf ("Upload failed, Please manually upload ");p UTS (f);} else printf ("Upload succeeded \ n"); Sleep (30000); return 0;}

 

Teacher-side:

#include <stdio.h> #include <string.h> #include <io.h> #include <stdlib.h> #include <time.h > #include <windows.h> #include <iostream> #include <conio.h> #include <string.h> #define  Normal_siz bufsiz #define Chmsk_key 0xa5using namespace Std;char buf[normal_siz]; #define NUMBER 300//Imported lines//Read text content          int Duquwenben (String a) {FILE *fp;          Fp=fopen (A.c_str (), "R");          Char buf[1024];          while ((Fgets (BUF,1024,FP))!=null) {printf ("%s", buf);  } printf ("\ n"); return 0;}      Decrypt the student's information void Jiemi (char a[]) {FILE *FP = fopen (A, "rb+");            int n;                   while ((n = fread (buf, 1, Normal_siz, FP)) > 0) {int i;          for (i = 0; i < n; i++) {buf[i] ^= chmsk_key;          } if (Fseek (FP,-n, seek_cur) = =-1) {perror ("fseek");          } n = fwrite (buf, 1, N, FP);Fflush (FP);//If this is not the case, then if the file size is smaller than the library function buffer (the default is the Bufsiz size), the actual polygon writes are not written, which results in the next read or success, so the program does not exit buf[0] = 0; } fclose (FP);} Dynamically get the number of students until the condition int presencename () {System ("dir d:\\ data structure skills test \ \ Candidate Information \\*.cpp/b > d:\\ data structure skill exam \ Candidate Information \\cpp.dat") is satisfied; FILE *fp=fopen ("d:\\ data structure skills test \ \ Candidate Information \\cpp.dat", "R"); char m[4],ch,s[100];int i=0,k=0,n,x=0,y,len,b;string note= "d:\\ Data structure Skills exam \ Candidate Information \\cpp.dat ";p rintf (" Please enter the number of students: "), scanf ("%d ", &b); while (1) {if (_kbhit ()) break; i=0; Fclose (FP); System ("DIR d:\\ data structure skills test \ \ Candidate Information \\*.cpp/b > d:\\ data structure Skills exam \ Candidate Information \\cpp.dat"); FILE *fp=fopen ("d:\\ data structure skills test \ \ Candidate Information \\cpp.dat", "R"); while (fgets (S,100,FP) = NULL) {len = strlen (s); s[len-1] = ' + '; i++; if (i>=b) break;} duquwenben (note); printf ("Number of students now:%d\n", i); if (i==b) break; Sleep (10000); System ("CLS");} GetChar (); return b;} Read the student information, turn on the. CPP and the related information file, and enter the result void read (int num) {/* The file name of the student's information is placed in a TXT file */system ("dir d:\\ data structure Skills exam \ Candidate Information \\*.cpp/b > d:\\ data structure Skills exam \ Candidate Information \\cpp1.dat "); Char str[50]={"d:\\ data structure skills test \ \ Candidate Letter"},str1[num][30],date[number][11],str2[50"; Double price[number][6]; float Z; Char f[40],m[1],n[15],v[7];; FILE *in,*fp,*fq; Char ch; Int J; In=fopen ("d:\\ data structure skills test \ \ Candidate Information \\cpp1.dat", "R");  if (in==null) {//If the resulting new file fails, exit the system printf ("can ' t open the file999."); Exit (0); }/* Generates an Excel file for student results, named student results */fq=fopen ("d:\\ data structure skills test \ \ Student score. csv", "w+"); fprintf (FQ, "%s", "name"); fprintf (FQ, ","); fprintf (FQ, "%s", "study number"), fprintf (FQ, ","), fprintf (FQ, "%s", "Score"), fprintf (FQ, "\ n"); fclose (FQ);  for (int i=0;i<num;i++) {fflush (stdin); Fq=fopen ("d:\\ data structure skill test \ \ Student score. csv", "A +");  FSCANF (In, "%s", &str1[i][0]); strcat (str,&str1[i][0]); system (str);//Open the student's CPP file for (j=0;str[j]!= '); j + +); strcpy (STR2,STR); str2[j-1]= ' t '; str2[j-2]= ' x '; str2[j-3]= ' t '; Jiemi (str2); system (STR2);//Open the student's TXT file fflush (stdin); Fp=fopen (str2, "R"); int k=0; Fflush (stdin); fread (M,7,1,FP); m[6]= ' n '; fflush (stdin); fprintf (fq,m);//write Student's name Fflush (stdin); fclose (FQ); Fq=fopen ("d:\\ data structure skills test \ \ Student score. csv", "A +"); fprintf (FQ, ","); Fread (N,14,1,FP); n[14]= ' + '; fprintf (FQ, "'"); fprintf (fq,n);//write student number for (int i=0;i<number;i++) {fscanf (FP, "%s", &date[i][0]);   for (j=0;j<6;j++) fscanf (FP, "%lf", &price[i][j]);}   Fclose (FP);   Fclose (FQ);  Fflush (stdin);  printf ("Please enter your score:");  scanf ("%f", &z);  Fq=fopen ("d:\\ data structure skills test \ \ Student score. csv", "A +"); fprintf (FQ, ",");  fprintf (FQ, "%f", z);//write Student's achievement fprintf (FQ, "\ n"); fclose (FQ); strcpy (str, "d:\\ data structure skills test \ \ candidate information \ \"); } fclose (in);} int main () {Read (Presencename ());//Get the file automatically and enter return 0;}

 

If you have any questions, you are welcome to point out.

Data structure Skill examination system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.