From 7f3ee77acde59bc5cbbd51b95f6d6958031d8202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9D=E6=9C=B1=E9=B9=8F=E4=BF=8A=E4=BF=8A?= <1106548749@qq.com> Date: Thu, 10 Jan 2019 20:25:31 +0800 Subject: [PATCH] first commit --- c3.cpp | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 c3.cpp diff --git a/c3.cpp b/c3.cpp new file mode 100644 index 0000000..8216fcc --- /dev/null +++ b/c3.cpp @@ -0,0 +1,111 @@ +#include"c1.cpp" +void section() //学生成绩分段 +{ + system("cls"); + int k=0; + double c; + if((fp=fopen("a.txt","r"))==NULL) + { + printf("Cannot open the file!\n"); + + } + while(fscanf(fp,"%lf%s%f",&s[k].no,s[k].name,&s[k].cscore)!=EOF) + { + k++; + } + printf("\t\t\t 90分以上学生的信息!\n"); + for(i=0;i=90) + printf("\t\t\t%.0lf %s %.1f\n",s[i].no,s[i].name,s[i].cscore); + printf("\n\n"); + printf("\t\t\t 80到89分学生的信息!\n"); + for(i=0;i=80) + printf("\t\t\t%.0lf %s %.1f\n",s[i].no,s[i].name,s[i].cscore); + printf("\n\n"); + printf("\t\t\t 60到79分学生的信息!\n"); + for(i=0;i=60&&s[i].cscore<80) + printf("\t\t\t%.0lf %s %.1f\n",s[i].no,s[i].name,s[i].cscore); + printf("\n\n"); + printf("\t\t\t 60分以下学生的信息!\n"); + for(i=0;i=60) + j++; + } + for(i=0;i