#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include<string.h>
#include<windows.h>
struct Student
{
char num[11] ;
char name[8] ;
int chinese;
int math;
int english;
int pe;
};
const int MAX=50;
struct Student stuLists[MAX] ;
int flog= 0;
int IsExist(char num[]);
int Find(char key[]);
/*************************************************控制台需要使用的函数********************************************************/
//光标定位
void gotoxy(int x,int y)
{
COORD cd;
cd.X = x;
cd.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),cd);
}
//红字黑底
void RinB()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_RED);
}
//兰字黑底
void CinB()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_GREEN | FOREGROUND_BLUE);
}
//黄字黑底
void YinB()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |
FOREGROUND_RED | FOREGROUND_GREEN);
}
/***************************************************绘制窗体的UI部分**********************************************************/
//绘制主菜单
void DrawMenu()
{
system("cls");
RinB();
printf("╭⌒╮棉花糖━┅~ ¤ ╭⌒╮ ╭⌒╮ ╭⌒╮\n");
printf("╭⌒╭⌒╮╭⌒╮~╭⌒╮︶︶, ︶︶ ︶︶ \n");
printf(",︶︶︶︶,''︶~~ ,''~︶︶ ,'' \n");
printf("********************************************************************************\n");
gotoxy(32,3);
YinB();
printf("学生信息管理系统v.10");
CinB();
gotoxy(40,5);
printf("制作:棉花糖(邓劲松)\n座右铭:将简单做到极致,你也就不简单了!\n");
printf("************************************************************************");
gotoxy(40,8);
gotoxy(30, 8);
printf("-------------主界面-------------------");
gotoxy(32, 10);
printf("1、个人基本信息管理");
gotoxy(32,11);
printf("2、班级基本信息管理");
gotoxy(32, 12);
printf("3、学生成绩信息管理");
gotoxy(32, 13);
printf("4、退出系统");
gotoxy(0, 15);
printf("使用数字键来选择!Esc键可以退出");
gotoxy(39,17);
printf("╱◥█◣ ╱◥█◣ ");
gotoxy(39, 18);
printf("︱田︱田︱︱田︱田︱ ");
gotoxy(39, 19);
printf("╬╬╬╬╬╬╬╬╬╬╬╬╬╬");
gotoxy(39, 22);
}
//绘制个人信息窗体
void DrawInfo()
{
system("cls");
RinB();
printf("╭⌒╮棉花糖━┅~ ¤ ╭⌒╮ ╭⌒╮ ╭⌒╮\n");
printf("╭⌒╭⌒╮╭⌒╮~╭⌒╮︶︶, ︶︶ ︶︶ \n");
printf(",︶︶︶︶,''︶~~ ,''~︶︶ ,'' \n");
printf("********************************************************************************\n");
gotoxy(32,3);
YinB();
printf("个人信息管理界面");
CinB();
gotoxy(32, 5);
printf("1、增加用户");
gotoxy(32,6);
printf("2、查看用户");
gotoxy(32, 7);
printf("3、查找用户");
gotoxy(32, 8);
printf("4、删除用户");
gotoxy(32, 9);
printf("5、修改用户");
gotoxy(0, 10);
printf("使用数字键来选择!Esc键可以退出");
/* gotoxy(39,17);
printf("╱◥█◣ ╱◥█◣ ");
gotoxy(39, 18);
printf("︱田︱田︱︱田︱田︱ ");
gotoxy(39, 19);
printf("╬╬╬╬╬╬╬╬╬╬╬╬╬╬");*/
gotoxy(39, 22);
}
//绘制班级管理窗体
void DrawClass()
{
system("cls");
printf("\n");
printf("\n");
printf ("*******************个人信息管理系统**二级菜单*******************");
}
//绘制对话框
void DrawDialog(char num[])
{
system("cls");
gotoxy(20,5);
printf("┌───────────────────────┐");
gotoxy(33,5);
printf(num);
gotoxy(20,6);
printf("│ │");
gotoxy(20,7);
printf("└───────────────────────┘");
}
//绘制学生信息
void DrawItem(Student temp)
{
printf("\n姓名");
printf(temp.name );
printf("\t 学号");
printf(temp.num );
printf("\t 语文");
printf("%d",temp.chinese );
printf("\t 数学");
printf("%d",temp.math );
printf("\t 英语");
printf("%d",temp.english );
printf("\t 体育");
printf("%d",temp.pe );
printf("\n");
}
/***********************************************************逻辑结构***********************************************************/
//增加一个学生
void AddStudent()
{
char getKey=0;
while(getKey !=27&&flog<=50)
{
system("cls");
Student stu={};
printf("名字");
scanf("%s",stu.name );
printf("学号");
scanf("%s",stu.num );
if(IsExist(stu.num )==1)
{
RinB();
gotoxy(20,12);
printf("┌───────────────────────┐");
gotoxy(40,12);
printf("警告!");
gotoxy(20,13);
printf("│ │");
gotoxy(20,14);
printf("└───────────────────────┘");
gotoxy(24,13);
printf("大哥想点有创意的嘛 这个重复了!");
CinB();
getch();
break;
}
printf("语文成绩");
scanf("%d",&stu.chinese );
printf("英语成绩");
scanf("%d",&stu.english );
printf("数学成绩");
scanf("%d",&stu.math );
printf("体育成绩");
scanf("%d",&stu.pe );
printf("该学生输入完成");
stuLists[flog]= stu;
printf("你还输入不?Esc退出 其他键继续\n");
getKey = getch();
flog++;
}
}
//删除一个学生
void RemoveStu()
{
DrawDialog("输入删除的学生学号");
gotoxy(23,6);
char stuNum[11];
scanf("%s",stuNum);
int result = Find(stuNum);
if (result>=0)
{
if(result ==flog-1)
{
flog--;
return;
}
else
{
Student temp;
int j=0;
for(int i =result;i<flog-1;i++)
{
j++;
temp= stuLists[j];
stuLists[i]= temp;
}
}
}
else
{
RinB();
gotoxy(20,12);
printf("┌───────────────────────┐");
gotoxy(40,12);
printf("警告!");
gotoxy(20,13);
printf("│ │");
gotoxy(20,14);
printf("└───────────────────────┘");
gotoxy(24,13);
printf("该学号不存在!");
CinB();
getch();
}
}
//修改学生信息
void UpdateStu()
{
DrawDialog("输入需要修改的学生学号");
gotoxy(23,6);
char stuId[11];
scanf("%s",stuId);
int stuNum= 0;
stuNum= Find(stuId);
if(stuNum>=0)
{
system("cls");
Student stu=stuLists[stuNum];
printf("名字");
scanf("%s",stu.name );
/* printf("学号");
scanf("%s",stu.num );
if(IsExist(stu.num )==1)
{
RinB();
gotoxy(20,12);
printf("┌───────────────────────┐");
gotoxy(40,12);
printf("警告!");
gotoxy(20,13);
printf("│ │");
gotoxy(20,14);
printf("└───────────────────────┘");
gotoxy(24,13);
printf("大哥想点有创意的嘛 这个重复了!");
CinB();
getch();
}*/
printf("语文成绩");
scanf("%d",&stu.chinese );
printf("英语成绩");
scanf("%d",&stu.english );
printf("数学成绩");
scanf("%d",&stu.math );
printf("体育成绩");
scanf("%d",&stu.pe );
printf("该学生修改完成");
stuLists[stuNum]= stu;
getch();
}
else
{
RinB();
gotoxy(20,12);
printf("┌───────────────────────┐");
gotoxy(40,12);
printf("警告!");
gotoxy(20,13);
printf("│ │");
gotoxy(20,14);
printf("└───────────────────────┘");
gotoxy(24,13);
printf("学号不存在!");
CinB();
getch();
}
}
//显示所有学生
void ShowList()
{
system("cls");
for(int i = 0;i<flog;i++)
{
DrawItem(stuLists[i]
没有合适的资源?快使用搜索试试~ 我知道了~
C语言学生管理系统(彩色控制台界面)
共22个文件
cpp:3个
obj:3个
pdb:2个
2星 需积分: 50 39 下载量 15 浏览量
2009-04-01
16:36:51
上传
评论 1
收藏 3.53MB RAR 举报
温馨提示
用vc自己做的一个学生管理系统 界面非常漂亮 用彩色的控制台界面 适合大家参考
资源推荐
资源详情
资源评论
收起资源包目录
C_StudentMIS.rar (22个子文件)
C_StudentMIS
C_StudentMIS.sln 902B
C_StudentMIS.ncb 13.43MB
Debug
C_StudentMIS.pdb 483KB
C_StudentMIS.ilk 334KB
C_StudentMIS.exe 39KB
C_StudentMIS.suo 25KB
C_StudentMIS
Main.cpp 10KB
UI.cpp 2B
C_Form.cpp 110B
C_StudentMIS.vcproj.COOS.绵白糖.user 1KB
Debug
C_StudentMIS.exe.embed.manifest.res 728B
UI.obj 1KB
C_Form.obj 4KB
vc90.idb 435KB
BuildLog.htm 9KB
C_StudentMIS.exe.embed.manifest 663B
mt.dep 67B
Main.obj 60KB
vc90.pdb 108KB
C_StudentMIS.exe.intermediate.manifest 621B
C_StudentMIS.vcproj 4KB
C_StudentMIS.h 409B
共 22 条
- 1
djs2007
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页