1、 题目《学籍管理系统》
2、 基本信息:
学号、姓名、性别、四科成绩、总成绩
3、 基本功能要求:
* 学生信息录入:录入这个学生的基本信息。
* 学生信息查询:输入学号,可是查询该生的各科成绩和总成绩。
* 学生信息排序:按学生的总成绩进行排序。
* 学生信息查找:输入一个学号,可以查找这个学生的个人相关信息,如果存在,则输出显示;如不存在,则显示无此人。
* 学生信息输出
自己再改改吧
#include <conio.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef struct student
{
char name[20];
int tele1;
int tele2;
}STU;
char mainscreen(void)
{ textbackground(YELLOW); clrscr();
window(10,3,70,22);
textbackground(RED); clrscr();
textcolor(GREEN);
gotoxy(16,3); cputs("1. input");
gotoxy(16,5); cputs("2. enquare");
gotoxy(16,7); cputs("3. update");
gotoxy(16,9); cputs("4. print");
gotoxy(16,11);cputs("0. exit");
textcolor(LIGHTGRAY);
gotoxy(16,13);cputs("please choice(0-4):");
textcolor(BLUE+BLINK);
gotoxy(36,13);
textcolor(BLUE);
return(getche());
}
STU head[20];
int number=0;
void pressanykey(int i,int j)
{ gotoxy(i,j); cputs("=========press any key to continue========");
getche();clrscr();
}
void input()
{ FILE *fp;
char filename[20];
int scoresum;
window(20,6,60,10);
textbackground(CYAN); clrscr();
textcolor(BLUE);
gotoxy(4,2); cputs("input file name:"); gets(filename);
fp=fopen(filename,"r");
if(fp==NULL)
{gotoxy(6,4); cputs("file not found!"); pressanykey(3,5);return;}
int i;
while(!feof(fp))
{fscanf(fp,"%s%*c%d %d",head[number].name,&head[number].tele1,&head[number].tele2);
number++;
}
fclose(fp);
}