You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
4.2 KiB

11 months ago
#include<stdio.h>//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͱѱ<CDB0><D1B1><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#include<stdlib.h>
#include<string.h>
typedef struct giepaper{
char name[100];
char qa[100];
char qb[100];
char qd[100];
char qc[100];
char answer;
}gie;
typedef struct fensi{
char name[50];
int num;
int grade;
}CLT;
gie k;
gie m[100];
CLT fs[10];
int i=0,t=0,j=0;//i<><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> j<><6A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD>
int itry();
void savingfile();
void adding();
void reveal();
int main(){
char ch;
int h;
FILE *fp1;
fp1=fopen("giegie.txt","a+");
printf("************************\n");
printf("*<2A><>ӭʹ<D3AD><CAB9>giegie<69><65><EFBFBD><EFBFBD>ϵͳ*\n");
printf("************************\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD>ͬѧ\n");
printf("<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ\n");
getchar();
if(fp1==NULL){
printf("<EFBFBD>޷<EFBFBD><EFBFBD>򿪸<EFBFBD><EFBFBD>ļ<EFBFBD>:giegie.txt:(\n");
exit(0);
}
while(!feof(fp1)){
fscanf(fp1,"%s %s %s %s %s %c ",k.name,k.qa,k.qb,k.qc,k.qd,&k.answer);//Ϊʲô<CAB2><C3B4><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ո񣿣<D5B8><F1A3BFA3><EFBFBD>
//printf("%s %s %s %s %s \n",k.name,k.qa,k.qb,k.qc,k.qd);
i++;
}
rewind(fp1);
for(int a=0;a<i;a++){
fscanf(fp1,"%s %s %s %s %s %c ",m[a].name,m[a].qa,m[a].qb,m[a].qc,m[a].qd,&m[a].answer);
}
printf("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>Y/y<><79><EFBFBD>룬N/n<><6E><EFBFBD><EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ\n");
ch=getchar();
getchar();
if(ch=='Y'||ch=='y'){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%d",&t);//<2F><><EFBFBD><EFBFBD>
getchar();
for(int a=0;a<t;a++){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%dλ<64><EFBFBD>۵<EFBFBD><DBB5><EFBFBD>Ϣ\n",a+1);
printf("ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s %d",fs[a].name,&fs[a].num);
}
printf("<EFBFBD><EFBFBD>׼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>׼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ\n");
printf("ף<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
getchar();
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>\n",i);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч\n");
for(int b=0;b<t;b++){
printf("<EFBFBD>ֵ<EFBFBD>%dλ<64><EFBFBD><E6B0AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",b+1);
fs[b].grade=itry(t);
}
}else{
t=1;
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>۵<EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
printf("ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s %d",fs[0].name,&fs[0].num);
printf("<EFBFBD><EFBFBD>׼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>׼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ\n");
printf("ף<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
getchar();
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>\n",i);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч\n");
fs[0].grade=itry(t);
}
for(int b=0;b<t;b++){
printf("<EFBFBD><EFBFBD>%dλͬѧ<CDAC>ijɼ<C4B3>Ϊ%d\n",b+1,fs[b].grade);
}
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>van<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
getchar();
for(int b=0;b<t;b++){
printf("%sͬѧ,",fs[b].name);
if(fs[b].grade==90||fs[b].grade==100){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۣ<EFBFBD>\n");
}
else if(fs[b].grade==0){
printf("<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>Ӱɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
}
else{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ŬŬ<C5AC><C5AC><EFBFBD>ɣ<EFBFBD>\n");
}
}
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD><EFBFBD>ܡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
while(1){
printf("*******1.<2E><EFBFBD><E9BFB4><EFBFBD><EFBFBD>****2.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ*******\n");
printf("*********<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD>˳<EFBFBD>ϵͳ*********\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫѡ<EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD>ܵı<EFBFBD><EFBFBD><EFBFBD>:\n");
scanf("%d",&h);
getchar();
switch(h){
case 1: reveal();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
break;
case 2: adding();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
break;
default:
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD>\n");
return 0;
}
}
rewind(fp1);
savingfile();
fclose(fp1);
//printf("%d",i);
return 0;
}
int itry(int t){
char key;
int count=0;
for(int a=0;a<i;a++){
printf("<EFBFBD><EFBFBD>%d<>\n",a+1);
printf("%s\n",m[a].name);
printf("%s\n",m[a].qa);
printf("%s\n",m[a].qb);
printf("%s\n",m[a].qc);
printf("%s\n",m[a].qd);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>:\n");
key=getchar();
getchar();
system("cls");
if(key==m[a].answer){
count+=10;
}
}
return count;
}
void adding(){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>\n");
gets(m[i].name);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Aѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
gets(m[i].qa);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Bѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
gets(m[i].qb);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Cѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
gets(m[i].qc);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
gets(m[i].qd);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
m[i].answer=getchar();
i++;
}
void reveal(){
for(int a=0;a<i;a++){
printf("<EFBFBD><EFBFBD>%d<>\n",a+1);
printf("%s\n",m[a].name);
printf("%s\n",m[a].qa);
printf("%s\n",m[a].qb);
printf("%s\n",m[a].qc);
printf("%s\n",m[a].qd);
}
}
void savingfile(){
FILE *fp2;
fp2=fopen("newgiegie.txt","r+");
if(fp2==NULL){
printf("<EFBFBD>ļ<EFBFBD>newgiegie.txt<78>򲻿<EFBFBD>\n");
}
for(int a=0;a<i;a++){
fprintf(fp2,"%s %s %s %s %s %c ",m[a].name,m[a].qa,m[a].qb,m[a].qc,m[a].qd,&m[a].answer);
}
fclose(fp2);//û<><C3BB>ִ<EFBFBD>о<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}