当前位置:三九宝宝网 → 宝宝教育 → 教学论文 → 正文

c语言课程设计:成绩记录簿望高手帮忙!

更新:12-25 整理:39baobao.com
字体:

[爱尔兰有哪些不看雅思和高考成绩的一般大学]有啊,不过全是国际班,就是说去就是先读语言,这个还得提醒你下,你收到语言offer时候得看看有没有同时收到大学的offer,如果没有那么这样的学校很不建议申啊,自己遭罪,而且与你一起上...+阅读

正好有个: #include #include #include #include #include #include using namespace std; struct xueshengguanli { string name; string xibie; string banbie; string sex; int num; float zongheCJ; xueshengguanli *next; }; typedef xueshengguanli* xueshengGL; xueshengGL Input(xueshengGL head) { char; int m=0; xueshengGL p1,p2,top; ofstream out_stream; out_stream.open("student.txt",ios::app); //以追加数据信息打开文件 if(out_stream.fail()) { cout exit(1); } while(SEL=='y'||SEL=='Y') { p1=new xueshengguanli; p1->next=NULL; cout cin>>p1->name; cout cin>>p1->num; cout cin>>p1->sex; cout cin>>p1->xibie; cout cin>>p1->banbie; cout cin>>p1->zongheCJ; if(m==0) { head=p1; p2=head; m=1; } else { p2->next=p1; p2=p1; } cout cin>>SEL; } top=head; //写入文件 while(head!=NULL) { out_streamnamenumsexxibie banbiezongheCJ; head=head->next; } out_stream.close(); //关闭文件 if(SEL=='n'||SEL=='N') cout return top; //返回链表头结点地址 } //从文件里读取数据 xueshengGL WenJian(xueshengGL top) { int n=0; xueshengGL p,h; ifstream in_stream; in_stream.open("student.txt"); if(in_stream.fail()) { cout return 0; } while(1) { if(in_stream.eof()) break; else {p=new xueshengguanli; p->next=NULL; in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ; if(n==0) { top=p; h=top; n=1; } else { h->next=p; h=p; } } } in_stream.close(); return top; } void xuanzhe(xueshengGL top) { int h; while(h3) { cout cin>>h; if(h==1) { cout cin>>top->xibie; break; } else if(h==2) { cout cin>>top->banbie; break; } else if(h==3) { cout cin>>top->zongheCJ; break; } else cout } } //修改 xueshengGL Change(xueshengGL top) { string NAME; int NUM,l=0; char; xueshengGL q,head; cout cin>>NAME; cout cin>>NUM; top=WenJian(top); q=top; while(top!=NULL) { if(top->name==NAME&top->num==NUM) { l=1; while(SEL=='y'||SEL=='Y') { cout xuanzhe(top); cout cout coutnamenumsexxibie banbiezongheCJ cout cin>>SEL; } if(SEL=='n'||SEL=='N') cout break; } else top=top->next; } //修改后学生信息写入文件 if(l==1) { head=q; ofstream out_stream; out_stream.open("student.txt",ios::trunc); //以覆盖文件原数据方式打开文件 if(out_stream.fail()) { cout exit(1); } while(head!=NULL) { out_streamnamenumsexxibie banbiezongheCJ; head=head->next; } out_stream.close(); } else cout return q; } //删除 xueshengGL Del(xueshengGL top) { string NAME; int NUM,l=0,n=0; xueshengGL p,h,q,back,head; cout cin>>NAME; cout cin>>NUM; ofstream out_stream; ifstream in_stream; in_stream.open("student.txt"); if(in_stream.fail()) { cout cout return 0; } while(1) { if(in_stream.eof()) break; else {p=new xueshengguanli; p->next=NULL; in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ; if(n==0) { top=p; h=top; n=1; } else { h->next=p; h=p; } } } in_stream.close(); q=top; while(1) { if(NAME==top->name&NUM==top->num&top->next==NULL) { l=2; top=q->next; out_stream.open("student.txt",ios::trunc);//删除文件 break; } if(NAME==top->name&NUM==top->num&top->next!=NULL) { l=1; top=q->next; cout break; } if(q->next==NULL) { printf("\nNot Found!\n"); break; } back=q; q=q->next; if(NAME==q->name&NUM==q->num) { l=1; back->next=q->next; cout break; } } //删除学生信息后重新写入文件 if(l==1) { head=top; out_stream.open("student.txt",ios::trunc); if(out_stream.fail()) { cout exit(1); } while(head!=NULL) { out_streamnamenumsexxibie banbiezongheCJ; head=head->next; } out_stream.close(); } else if(l==2) cout else cout return top; } //查询 xueshengGL LookUp(xueshengGL top) { string XM; int number,l=0; cout cin>>XM; cout cin>>number; top=WenJian(top); while(top!=NULL) { if(XM==top->name&number==top->num) { l=1; cout cout cout coutnamenumsexxibie banbiezongheCJ break; } else top=top->next; } if(l==1) cout else cout cout return top; } xueshengGL sort(xueshengGL top) { string name1,xibie1,banbie1,sex1; int num1; float zongheCJ1; int n=0,l=0; xueshengGL p1,p2,p3,p,h,head; ifstream in_stream; in_stream.open("student.txt"); if(in_stream.fail()) { cout cout return 0; } while(1) { if(in_stream.eof()) break; else {p=new xueshengguanli; p->next=NULL; in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ; l=1; if(n==0) { top=p; h=top; n=1; } else { h->next=p; h=p; } } } in_stream.close(); for(p1=top;p1->next!=NULL;p1=p1->next) { l=1; for(p2=p1->next;p2!=NULL;p2=p2->next) { if(p1->zongheCJ zongheCJ) { name1=p1->name; p1->name=p2->name; p2->name=name1; num1=p1->num; p1->num=p2->num; p2->num=num1; sex1=p1->sex; p1->sex=p2->sex; p2->sex=sex1; xibie1=p1->xibie; ...

本文地址:https://www.39baobao.com/show/29_15149.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.

以下为关联文档:

考试成绩差怎样写评语1、从孩子的卷子上来看,专业成绩算得上优秀。和上一次相比较,没有退步也没有进步。希望孩子继续努力,更上一层楼。同时也感谢教师平日对我孩子的培养,但是孩子还是有很多要努力...

孩子考试成绩差家长怎样写评语1、孩子算优秀。希望孩子继续努力,更上一层楼。同时也感谢教师平日对我孩子的培养,但是孩子还是有很多要努力的地方。有劳老师以后继续费心教育孩子。我们家长一定会鼎力支持,...

数据结构用C语言实现基于链表的学生成绩管理系统根据学号和看可以不咯?#includeintavgGrade(inta[50]){inti,sum=0,max=0,min=0;doubleavg=0.0;max=a[0];min=a[0];for(i=0;imax)max=a[i];if(a[i]a[i]){temp=a[i];a[i]=a[j];a[j]=temp;...

C语言制作成绩记录簿#include<stdio,h> #include<stdlib.h> struct node { char data;struct node *next;}; struct node *insert(struct node *h,char c) { struct node *p,*p1,*p2; p=(struct...

C语言编程题目学生成绩记录簿设计#include#include#includestatic int num=0; void mainmenu(); typedef struct S1 Student; struct S1 { S1(){ no[9]='\0'; name[15]='\0'; sum=0.0; average=0.0; next=NU...

编制一个C语言成绩记录簿设计要求: 成绩记录簿中记录以下数据:学号、姓名、课程编号、课程名称、成绩、学分,所有成绩都以百分制计分。在程序中可以输入新的成绩记录,可以按学号或姓名查询一个学生的所...

C语言编一个成绩记录簿我花了一天时间写的,自己也学了下文件,感觉还不错,界面什么都比较友好了,提示也很多。如果网页显示代码不是很好的话发个邮箱给我,我把txt文件发给你,里面已经加入了写入文件功能...

编制一个C语言成绩记录簿要求每个学生信息包括:学号姓名 C我以前做过的一个, 你看看, /* 数据描述:学号 姓名 班级 高数 英语 总分 程序完成功能: (1) 浏览数据 (2) 增加数据 (3) 修改数据 (4) 查询数据(按姓名,按总分) (5) 退出 */ #include #includ...

编制一个c语言成绩记录簿每个学生信息包括:学号姓名 c语言成/*students.c*/ #include#include#include#include "students.h" struct list //结构体 { int sno; char sname[2]; int sage; char sprof[2]; int sclass; struct list *next...