Information Management System
Information Management System
一.代码部分
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
typedef struct STU {
char name[20];
char sex[5];
char num[20];
char _class[20];
char score[5];
};
void home(void) { //显示进入画面
printf("\n\n\n\n");
printf("================================================================================\n\n");
printf("================================================================================\n\n");
printf("*************************欢迎使用学生成绩管理系统*******************************\n\n");
printf("-----------------------------------------------------------------制作人:Sogger\n\n");
printf("****************************----Welcome!----************************************\n\n");
printf("================================================================================\n\n");
printf("================================================================================\n\n");
printf(" 请按任意键进入学生成绩管理系统\n\n\n\n\n");
system("pause >nul");
system("cls");
}
void end(void) { //显示结束画面
printf("\n\n\n");
printf("================================================================================\n\n");
printf("================================================================================\n\n");
printf("*************************感谢使用学生成绩管理系统***********************************\n\n");
printf("********************************************************************************\n\n");
printf("================================================================================\n\n");
printf("请按任意键退出学生管理系统\n");
system("pause >nul");
exit(0);
}
void Output(struct STU* stu2) { //对成绩排行进行输出
system("cls");
int i;
printf(" 成绩排行如下\n\n");
printf("\t姓名\t性别\t学号\t\t班级\t\t线代成绩\n");
for (i = 0; i < 10; i++) {
printf(" %s %s %s %s %s\n", stu2[i].name, stu2[i].sex, stu2[i].num, stu2[i]._class, stu2[i].score);
}
}
void ScoreTotal(struct STU* stu) { //对成绩进行排行
struct STU temp;
int i,j;
for (i = 0; i < 9; i++) {
for (int j = i + 1; j < 10; j++) {
if (stu[j].score > stu[i].score) {
temp = stu[j];
stu[j] = stu[i];
stu[i] = temp;
}
}
}
Output(stu);
}
int main() {
FILE* fp;
STU stu[10],stu2[10];
int i,a;
char temp[10][20];
char stu1[10][100];
system("title 学生成绩管理系统"); //设置标题
system("mode con cols=80 lines=25"); //调节窗口高度宽度
system("color F5"); //调节背景和字体颜色
home();
for (i = 0; i < 10; i++) {
printf(" 请录入学生信息\n\n");
printf(" 学生%d\n\n", i+1);
printf(" 姓名\t性别\t学号\t\t班级\t\t线代成绩\n");
printf(" ");
scanf("%s %s %s %s %s", stu[i].name, stu[i].sex, stu[i].num, stu[i]._class, &stu[i].score);
strcpy(temp[i], stu[i].name);
strcat(temp[i], ".txt");
if ((fp = fopen(temp[i], "w+")) == NULL) {
printf("File open error!\n");
exit(0);
}
fprintf(fp, "%s %s %s %s %s", stu[i].name, stu[i].sex, stu[i].num, stu[i]._class, stu[i].score);
if (fclose(fp)) {
printf("Can not close the file!\n");
exit(0);
}
system("cls"); //清空当前界面
}
printf(" 以下是十位同学的信息\n\n");
printf("\t姓名\t性别\t学号\t\t班级\t\t线代成绩\n");
for (i = 0; i < 10; i++) {
if ((fp= fopen(temp[i], "r")) == NULL) {
printf("File open error!\n");
exit(0);
}
strcpy(stu2[i].name, stu[i].name);
fscanf(fp, "%s %s %s %s %s", stu2[i].name, stu2[i].sex, stu2[i].num, stu2[i]._class, stu2[i].score);
printf(" %s %s %s %s %s\n", stu2[i].name, stu2[i].sex, stu2[i].num, stu2[i]._class, stu2[i].score);
}
printf("\n\n\n 是否查看排行?\n 【1】是 【2】 否\n");
printf("\t\t\t\t");
scanf("%d", &a);
if (a == 1) ScoreTotal(stu2);
if (fclose(fp)) {
printf("Can not close the file!\n");
exit(0);
}
system("pause >nul"); //暂停且不显示任何东西
system("cls");
end();
return 0;
}
二.运行截图




三.system()函数的简单介绍
函数名:system() (需加头文件<stdlib.h>后才可以调用)
功能:实际上相当于执行一个DOS命令
用法: system("DOS命令");
下面介绍几个用法:
(1)system("color 颜色参数")
作用:改变屏幕窗口的背景色和文字颜色
参数选择:颜色属性由两个十六进制数字指定 ,第一个为背景色,第二个则为文字颜色
每个数字可以为以下任何值之一:
参数:0 = 黑色 1 = 蓝色 2 = 绿色 3 = 浅绿色 4 = 红色 5 = 紫色 6 = 黄色 7 = 白色 8 = 灰色
9 = 淡蓝色 A = 淡绿色 B = 淡浅绿色 C = 淡红色 D = 淡紫色 E = 淡黄色 F = 亮白色
如:添加代码 system("color 9F"),可以将屏幕窗口背景色设置为蓝色,文字颜色设置为白色。
注意:1. 如果只给定一个参数,则只设置背景色。如:system("color 9"),背景色为蓝色,文字颜色不变
2.如果没有给定任何参数,如:system("color"),该命令会将颜色还原到cmd启动时的默认颜色
(2)system("pause")
作用:暂停程序运行,以便于在屏幕上观察程序的执行结果
正常情况下,在运行结果后面会显示:按任意键继续. . .
这时候就很烦躁了,强迫症看着会很不爽,于是...
如果不想显示提示,可以使用输出重定向命令:
system("pause >nul");
这样屏幕上就不再显示“按任意键继续. . .”的提示了~~~~
注意:是nul,不是null !!!
大于号>,表示将命令结果输出重定向到文件、打印机等其他设备中
nul是DOS中的一个虚拟的空设备,">nul"表示把命令产生的屏幕显示信息重定向(>)到虚拟空设备
(nul),这样在屏幕上就不会显示pause命令的执行结果了~~
(3)system("cls")
作用:清除屏幕信息...
(4)system("title 标题内容")
作用:为程序调试的DOS窗口加上标题
效果如下:、
(5)system("mode con cols=窗口长度 lines=窗口宽度")
作用:调整DOS窗口的高度和宽度
。。。
。。。
。。。
。。。
Information Management System的更多相关文章
- 2015年5月9日 student information management system
/*大作业SIMS*///头文件 #ifndef __FUNC_C__ #define __FUNC_C__ #include <stdio.h> #include <stdlib. ...
- content management system
Defination of CMS: The definition of a CMS is an application (more likely web-based), that provides ...
- Database Management System 基础01:管理自己的任何事
前言 系列文章:[传送门] 这Database Management System 系列准备也慢慢的写出来了.Database Management是我学习的一块,这块出的也许比较慢.比较忙吧,坚持每 ...
- Network management system scheduling for low power and lossy networks
In one embodiment, a network management system (NMS) determines an intent to initialize a request-re ...
- Analysis of requirement specification of parking management system
Analysis of requirement specification of parking management system PURPOSE OF THE SYSTEM The parking ...
- Information Management Policy(信息管理策略)的使用范例
基础知识 很多人都会定期收拾自己的书架或者抽屉,把里面过旧的资料拿走,为新的资料腾出空间来,这样既可以节省空间,而且当冗余资料过多的时候也会降低你查找的速度和效率.那么,在企业的SharePoint中 ...
- Main Memory Object-Relational Database Management System
Main Memory Object-Relational Database Management System FastDBMain Memory Relational Database Manag ...
- Oracle Product Hub / Product Lifecycle Management / Product Information Management / Advanced Produc
In this Document Goal Solution 1. Master List showing sample code for APIs in Product Data Hub ...
- HR-人力资源管理系统(Human Resources Management System,HRMS)
人力资源管理系统(Human Resources Management System,HRMS),是指组织或社会团体运用系统学理论方法,对企业的人力资源管理方方面面进行分析.规划.实施.调整,提高企业 ...
随机推荐
- 两个对象值相同(x.equals(y)==true),但却可有不同的hashcode这句话对吗?
1.这句话当然不对啦,请参看官方文档给出的解释! hashCode public int hashCode()返回该对象的哈希码值.支持此方法是为了提高哈希表(例如 java.util.Hashtab ...
- 关于使用Java Mail发邮件的问题
今天做东西的时候突然遇到需要发邮件的问题,然后就使用SMTP协议进行邮件的发送.用了一个工具类简化邮件发送的功能, 在这次试验中,我使用了自己的QQ邮箱进行发送邮件的发送者. public class ...
- AI本质就是“暴力计算”?看华为云如何应对算力挑战
随着AI人工智能技术的飞速发展,相关的AI应用场景已经拓宽至各行各业.你可能想象不到的是,现在大家手上的智能手机的运算能力,甚至比美国航空航天局1969年登月计划中最先进计算机还高出几百上千万倍乃至更 ...
- 安装破解版IntelliJ IDEA
1.下载IntelliJ IDEA http://www.jetbrains.com/idea/download/#section=windows 选择Ultimate版本 2.注册码破解 http: ...
- 线段树+lazy标记 2019年8月10日计蒜客联盟周赛 C.小A的题
题目链接:https://nanti.jisuanke.com/t/40852 题意:给定一个01串s,进行m次操作,|s|<=1e6,m<=5e5 操作有两种 l r 0,区间[l,r] ...
- HihoCoder1466-后缀自动机六·重复旋律9
小Hi平时的一大兴趣爱好就是演奏钢琴.我们知道一段音乐旋律可以被表示为一段字符构成的字符串. 现在小Hi已经不满足于单单演奏了!他通过向一位造诣很高的前辈请教,通过几周时间学习了创作钢琴曲的基本理论, ...
- LightOJ 1344 Aladdin and the Game of Bracelets
It's said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a ...
- UVA-11107 Life Forms(求出现K次的子串,后缀数组+二分答案)
题解: 题意: 输入n个DNA序列,你的任务是求出一个长度最大的字符串,使得它在超过一半的DNA序列中出现.如果有多解,按照字典序从小到大输入所有解. 把n个DNA序列拼在一起,中间用没有出现过的字符 ...
- 洛谷 P2764(最小路径覆盖=节点数-最大匹配)
给定有向图G=(V,E).设P 是G 的一个简单路(顶点不相交)的集合.如果V 中每个顶点恰好在P 的一条路上,则称P是G 的一个路径覆盖.P 中路径可以从V 的任何一个顶点开始,长度也是任意的,特别 ...
- Local Model Poisoning Attacks to Byzantine-Robust Federated Learning
In federated learning, multiple client devices jointly learn a machine learning model: each client d ...