当前位置:首页 » 编程语言 » c语言学生信息管理系统有问题
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

c语言学生信息管理系统有问题

发布时间: 2022-05-01 18:50:07

1. 关于c语言编写一个学生信息管理系统的问题

那就用结构体 struct student{
int no;
char *name;
int age;
char *class;
char* phone;
char *address;
};
再定义一个结构体数组student students[n] ;n自己指定,最好用动态数组创建。像增删改查这样的操作你就对数组操作就行了

2. C语言链表版的学生信息管理系统的问题,为什么我的文件录入函数不能执行

请问一下,里面的pnew变量是表示的一个新节点吧?既然这样你里边的pnew变量是很乱的,根本构不成链,先定一个头节点,头节点不存储数据,后边依次链接各个节点,同时用malloc()函数申请存储空间。另外可以考虑把while()结构换成do - while结构
有问题发邮件 :[email protected]
[email protected]

3. c语言 学生管理系统 出现问题

这个是我最近编写的,跟你分享一下吧!!C++编的!!
#include<iostream>
#include<fstream>
#include<iomanip>
#include<string>

using namespace std;
struct student
{
string no;
char name[30];
float math,computer,english,policy ;
float sumScore;
}stu[100]={"0","0",0,0,0,0}; //定义了一个结构体类型的 学生学籍信息 数据类型

typedef struct collecemessage
{ string title;
float standardScare;
char collegename[50];
}; //定义了具有研究生招收权的学院信息 数据类型

collecemessage colmes[100]={"0",0,"0"}; //学院信息 全局结构体数组
collecemessage collectStuMes[100]={"0",0,"0"}; //学院信息采集后,满足条件的学生学院信息 全局级变量
int collectStucount=0; //满足条件学生个数统计变量 全局级变量
int FLAG=0; //用来验证 函数 void directMessage(int count1,int count2) 是否执行
string CollegeMessage="0"; //考研学院信息变量
string message="0";

void function(); // 学生考研成绩信息查询子系统 所有函数声明
void SumScore(int count);
void exiteNUMMessage(int count);
void MessageSort(int count);
void MessageSort(int count,string subject);
string Sortsubject();
int setup();
void displayMessage(int count);
void edit(int count);
int deleteStudent(int count1);
void xueyuanxinxijianjie();

int collegemessagesetup(); //大学生考研信息指南子系统 所有函数声明
void collegemessageedit(int count);
void displaycollegeMessage(int count);
void directMessage(int count1,int count2);
float StudentsumScore(int count);
void studentMessageDisplay(int count1,int count2);
string collegename();
void collectSchoolmes(int i);

int main()
{static int count1,count2;
function(); //显示程序的欢迎界面
system("pause");
system("cls") ;

loop2 :
system("cls");
for(int i=0;i<5;i++) cout<<endl;
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n\n";
cout<<"\t\t★ ★ 大学生考研模拟系统 ★ ★\n\n\n";
cout<<"\t\t★ ★ 1.学生考研成绩信息查询 ★ ★\n\n\n";
cout<<"\t\t★ ★ 2.大学生考研信息指南 ★ ★\n\n\n";
cout<<"\t\t★ ★ 0.退出系统 ★ ★\n\n\n";
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n\n";
int choice;
cout<<"============== 开始体验考研信息模拟系统给你带来的乐趣吧!!!!!==============="<<endl<<endl;
cout<<"你想进入的系统 ";cin>>choice;
switch(choice)
{ case 1:
{loop:
cout<<endl<<endl;
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n";
cout<<"\t\t★ 学生信息处理模块系统 ★\n\n";
cout<<"\t\t★ 1 - 录入学生信息 ★\n\n";
cout<<"\t\t★ 2 - 查找学生信息 ★\n\n";
cout<<"\t\t★ 3 - 显示学生信息 ★\n\n";
cout<<"\t\t★ 4 - 学生信息排序 ★\n\n";
cout<<"\t\t★ 5 - 修改学生信息 ★\n\n";
cout<<"\t\t★ 6 - 删除学生信息 ★\n\n";
cout<<"\t\t★ 0 - 退出 ★\n\n";
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n";

static int menu,tem=0;

string num;
int flag=0; //程序中设置了一个旗帜标记
cout<<endl<<">>>>>>>选择你的服务: ";cin>>menu;
system("cls");

switch (menu)
{
case 1:
{
count1=setup();
system("cls");
goto loop;
break;
}

case 2:
{ exiteNUMMessage(count1);
SumScore(count1);
cout<<endl<<"-----------------------请输入您想查询的学号-------------------------"<<endl;
cout<<"输入你要进行查找的学生学号: ";cin>>num;
cout<<endl<<endl; //这行功能是进行换行
for(int i=0;i<count1;i++)
if(stu[i].no==num && num!="0")
{tem=i;
cout<<" 学号 姓 名 计算机成绩 数学成绩 英语成绩 政治成绩"<<endl<<endl;
cout<<stu[tem].no<<setw(10)<<stu[tem].name<<setw(10)<<stu[tem].computer<<setw(15)\
<<stu[tem].math<<setw(15)<<stu[tem].english<<setw(13)<<stu[tem].policy<<setw(10)<<endl;
cout<<"\n\n**********"<<stu[tem].name<<"2010年考研总分是: "<<stu[tem].sumScore<<endl<<endl;
flag=1;
}

if(flag==0)
cout<<"对不起,该学号不存在!\n";
system("pause");
system("cls");
goto loop;
break;
}
case 3:
{ displayMessage(count1);
system("pause"); // 这一句的目的是让屏幕暂停一下,用户可以看到信息
system("cls"); // 清除屏幕信息
goto loop;
break;
}

case 4:
{ displayMessage(count1);
MessageSort(count1,Sortsubject());
displayMessage(count1);
system("pause"); // 这一句的目的是让屏幕暂停一下,用户可以看到信息
system("cls"); // 清除屏幕信息
goto loop;
break;
}

case 5:
{ displayMessage(count1);
edit(count1);
system("cls");
goto loop;
break;
}

case 6:
{ count1=deleteStudent(count1);
system("cls");
goto loop;
break;
}

case 0:
{ system("cls");
for(int i=0;i<5;i++)
cout<<endl;
cout<<"\t\t★ ★ ★ ★ ★ 谢 谢 使 用 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t★ 你好,感谢您进入学生信息处理模块系统 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 欢 迎 下 次 再 来 ★"<<endl<<endl<<endl;
cout<<"\t\t★ ★ ★ 欢迎返回大学生考研模拟系统主界面 ★ ★ ★"<<endl<<endl<<endl;
system("pause");
goto loop2;
break;
}

default:
{ for(int i=0;i<5;i++)
cout<<endl;
cout<<"\t\t\t★ ★ ★ ★ ★ 错 误 请 求 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t\t★ ★ ★ ★ ★ 重 新 选 择 操 作 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t\t★ ★ ★ ★ ★ 谢 谢 使 用 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t\t★ 您好!!忠告您一句,以后办事情要认真写些 !★"<<endl<<endl<<endl;
cout<<"\t\t\t★ ★ 欢迎返回大学生考研信息主界面 ★ ★"<<endl<<endl<<endl;
system("pause");
system("cls");
goto loop;
break;
}
}
break;
}
case 2:
loop3: {system("cls");
for(int i=0;i<5;i++) cout<<endl;
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n\n";
cout<<"\t\t★ 大学生考研信息指南 ★\n\n\n";
cout<<"\t\t★ 1 - 报考院校详细信息 ★\n\n\n";
cout<<"\t\t★ 2 - 学生考研结果信息 ★\n\n\n";
cout<<"\t\t★ 0 - 退出考研查询系统 ★\n\n\n";
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n\n";
int menu;
cout<<endl<<">>>>>>>选择你的服务: ";cin>>menu;
switch(menu)
{case 1:
{ loop1: system("cls");system("cls");
for(int i=0;i<3;i++) cout<<endl;
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n";
cout<<"\t\t★ 大学生考研学院信息模块 ★\n\n";
cout<<"\t\t★ 1 - 学院招生信息初始化 ★\n\n";
cout<<"\t\t★ 2 - 学院基本信息修改 ★\n\n";
cout<<"\t\t★ 3 - 学院基本信息显示 ★\n\n";
cout<<"\t\t★ 4 - 学院基本信息向导指南 ★\n\n";
cout<<"\t\t★ 0 - 退出 ★\n\n";
cout<<"\t\t★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★\n\n";

cout<<">>>>>>>选择你的服务: ";cin>>menu;
{ switch(menu)
{case 1:
{system("cls");
count2=collegemessagesetup();
goto loop1;
break;
}
case 2:
{system("cls");
collegemessageedit(count2);
goto loop1;
break;
}
case 3:
{ system("cls"); // 清除屏幕信息
displaycollegeMessage(count2);
system("pause"); // 这一句的目的是让屏幕暂停一下,用户可以看到信息
goto loop1;
break;
}
case 4:
{ directMessage(count1,count2);
system("pause"); // 这一句的目的是让屏幕暂停一下,用户可以看到信息
system("cls"); // 清除屏幕信息
goto loop1;
break;
}

case 0:
{ system("cls");
for(int i=0;i<5;i++)
cout<<endl;
cout<<"\t\t★ ★ ★ ★ ★ 谢 谢 使 用 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t★ 您好,大学生考研学院信息模块 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 欢 迎 下 次 再 来 ★"<<endl<<endl<<endl;
cout<<"\t\t★ ★ ★ 欢迎返回大学生考研信息指南主界面 ★ ★ ★"<<endl<<endl<<endl;
system("pause");
goto loop3;
break;
}
default:
{ for(int i=0;i<5;i++)
cout<<endl;
cout<<"\t\t\t★ ★ ★ ★ ★ 错 误 请 求 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t\t★ ★ ★ ★ ★ 重 新 选 择 操 作 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t\t★ ★ ★ ★ ★ 谢 谢 使 用 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t\t★ 您好!!忠告您一句,以后办事情要认真写些 !★"<<endl<<endl<<endl;
cout<<"\t\t\t★ ★ 欢迎返回大学生考研信息主界面 ★ ★"<<endl<<endl<<endl;
system("pause");
system("cls");
goto loop1;
break;
}
system("pause");
break;
}
}
}
case 2:
{system("cls");
studentMessageDisplay(count1,count2);
system("pause");
goto loop3;
break;
}
case 0:
{cout<<"\t\t★ ★ ★ ★ ★ 谢 谢 使 用 ★ ★ ★ ★ ★"<<endl<<endl<<endl;
cout<<"\t\t★ 您好,大学生考研学院信息模块 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 欢 迎 下 次 再 来 ★"<<endl<<endl<<endl;
cout<<"\t\t★ ★ ★ 欢迎返回大学生考研信息指南主界面 ★ ★ ★"<<endl<<endl<<endl;
}
goto loop2;
break;
}

}
case 0:
{ system("cls");
for(int i=0;i<5;i++) cout<<endl;
cout<<"\t\t★ ★ ★ ★ ★ 谢 谢 使 用 ★ ★ ★ ★ ★ "<<endl<<endl<<endl;
cout<<"\t\t★ 天 地 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 行 势 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 健 坤 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 自 厚 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 强 德 ★"<<endl<<endl<<endl;
cout<<"\t\t★ 不 载 ★"<<endl<<endl<<endl;

4. 我用C语言写了一个学生管理系统,录入有问题,请高手优化,运用链表

好啊
此题如此简单
让我来给你新的代码(自己编的)
代码如下:

#include<stdio.h>
#include<string.h>
#include<malloc.h>
#define NULL 0
#define LEN sizeof(struct student)
struct student
{
char num[10]; //学号
char name[20]; // 姓名
int age; //年龄
int sex; //性别
char regedit[20]; //籍贯
char tel_num[12]; //电话
char email[20]; //email
struct student *next; //
};
int n;
struct student * record()/* 建立信息 */
{
struct student *head,*p1,*p2;
int c;
head=p2=NULL;
n=0;
do
{
p1=(struct student *)malloc(LEN);
n=n+1;
/*p1->num='\0';
p1->name='\0';
p1->age=0;
p1->sex=0;
p1->regedit='\0';
p1->tel_num='\0';
p1->email='\0'; */
printf("\n");
printf("请输入学生的学号:\n");
gets(p1->num);
printf("请输入学生的姓名:\n");
gets(p1->name);
printf("请输入学生的年龄:\n");
scanf("%d",&p1->age);
printf("请输入学生的性别:(1代表男0代表女)\n");
scanf("%d",&p1->sex);
printf("请输入学生的籍贯:\n");
scanf("%s",p1->regedit);
printf("请输入学生的电话:\n");
// gets(p1->tel_num); //次行用gets 会出现错误
scanf("%s",p1->tel_num);
printf("请输入学生的E-mail:\n");
//gets(p1->email); //此行一样 用gets 会出现错误
scanf("%s",p1->email);
printf("\n请问是否继续注册?(1表示继续 2表示停止)\n");
scanf("%d",&c);
if(n==1)head=p1;
else p2->next=p1;
p2=p1;
}while(c==2);
p2->next=NULL;
return(head);
}

void main()
{
struct student *head;
head=record();
}
如果想要把 录入的数据输出 还可以在输出
要的话 给我留言!

5. C语言编写的学生信息管理系统的有关问题

数据结构可以用结构体,存储学生信息,要保存为文件,要用到FILE指针,课本上一般都有,打开文件也是用file

6. C语言 学生信息管理系统 来个大神帮我看看源代码那里有问题

这位兄台,问题蛮多的,真的要一一列举吗:

  1. 入口执行代码main函数没有要执行的东西呀?

  2. 知道int 是什么意思吗?就是一个数,范围:-4294967296 ~4294967296,号码就是一个数,所以不需要数组啦,比如你定义的int idcardnumber[20];那是20个范围在-4294967296 ~4294967296的数。

  3. scanf读数据要用取地址符号&。

  4. 你要用student 结构定义变量不需要每次都写一次定义,只要在开头给这个定义起个名字就好了:typedef struct student{} Student;以后要定义变量时就这样 Student s;

  5. if语句、定义函数要用{}要包含代码。

    先解决这些问题吧……

7. C语言学生信息管理系统中出现的问题

这是你自己写的程序吗?我很少使用这个类型,不太了解它的方法,要是源文件还是可以看看。下面是简单的分析。
FILE的用法学习了吗?
fwrite (&n,sizeof (int),1,fp2);//想文件中写入1个int的0啊?不是要删除吗?
size_t fwrite(const void* buffer, size_t size, size_t count, FILE* stream);

8. C语言建立学生信息管理系统 无法初始化

这是你自己写的程序吗?我很少使用这个类型,不太了解它的方法,要是源文件还是可以看看。下面是简单的分析。
FILE的用法学习了吗?
fwrite (&n,sizeof (int),1,fp2);//想文件中写入1个int的0啊?不是要删除吗?
size_t fwrite(const void* buffer, size_t size, size_t count, FILE* stream);
注意:这个函数以二进制形式对文件进行操作,不局限于文本文件
返回值:返回实际写入的数据块数目
(1)buffer:是一个指针,对fwrite来说,是要获取数据的地址;
(2)size:要写入内容的单字节数;
(3)count:要进行写入size字节的数据项的个数;
(4)stream:目标文件指针;
这个例子估计能对你有帮助;
56789101112131415161718192021 //程序示例 fwrite fread fseek #include <stdio.h> int main () { FILE *fp; char msg[] = "file content"; char buf[20]; fp = fopen("d:\\a\\a.txt","w+"); if (NULL == fp) { printf("The file doesn't exist!\n"); return -1; } fwrite(msg,strlen(msg),1,fp);//把字符串内容写入到文件 fseek(fp,0,SEEK_SET);//定位文件指针到文件开始位置 fread(buf,strlen(msg),1,fp);//把文件内容读入到缓存 buf[strlen(msg)] = '\0';//删除缓存内多余的空间 printf("buf = %s\n",buf); printf("strlen(buf) = %d\n",strlen(buf)); return 0; }

哎呀呀,不好意思啊。没看到你是.dat啊。
哈~看起来只是清除了st_num.dat,没有清除student.dat。是不是这个问题啊,而且看起来像课后题啊。

9. 学生管理系统c语言源代码帮我看看这程序出问题了

调了一下,没啥大问题啊?

struct stu_type {

char num[15];

char name[10];

int age;

int xibie;

xibie定义为int,scanf和printf里用的是%s,改成%d就不报错了。

另外case 2: display((char*)""); break; 这一行原来的过不了,强制转换一下过了