下载此文档

c学生信息管理系统.doc


文档分类:IT计算机 | 页数:约7页 举报非法文档有奖
1/7
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/7 下载此文档
文档列表 文档介绍
//*** ***** ***** ***** ***** ***** ***** ***** ***** ***** // //学生成绩管理系统 2010 . /JXN // //** ***** ***** ***** ***** ***** ***** ***** ***** ***** *// # inclu de<io strea m> #i nclud e<fst ream> #inc lude< strin g> #i nclud e<iom anip> usin g nam espac e std ;c lass Stude nt //** ***** ***** ***** ***** ***** 学生类{ priv ate: intn um; int age; cha rpho [50]; ch ar ad d[100 ]; char name[ 20]; cha r sex [4]; cha r bir [40]; publ ic: inpu t(); del et(); lo ok(); fi nd(); ch ange( ); appen d(); };S tuden t x[5 0]; St udent ::inp ut() //***** ***** ***** ***** ***** **输入{ loo p: int num, a=0,t ; fo r(int s=0; s<=50 ;s++) { co ut<<" 请输入学号(大于等于 1000 的四位数): "<<en dl; cin>> num; i fstre am fi le("a t",io s::bi nary) ; //以二进制打开文件 fi ekg(0 ,ios: :beg) ; for( inti =0;i< 50;i+ +) { file. read( (char *)&x [i],s izeof (x[i] ));//读取文件 if(nu m==x[ i].nu m)a=1 ; if (x[i] .num= =0){t =i;i= 50;} //t记录 i值, "i=50 "跳出循环} if (a==1 ||num <1000 ||num >9999 ){ cou t<<" 您输入的学号不合规则或已存在! " <<end l; go to loop; } el sex [t].n um=nu m; cout< <"请输入姓名: "< <endl ; ci n>>x[ t].na me; co ut<<" 请输入性别(男或女): "<<e ndl; cin >>x[t ].sex ; co ut<<" 请输入年龄: "<<e ndl; cin> >x[t] .age; cout< <"请输入生日(年/月/日): "<<en dl; cin>> x[t]. bir; cout <<" 请输入电话: " <<end l; c in>>x [t].p ho; cout< <"请输入地址: "< <endl ; ci n>>x[ t].ad d; s =50; //" s=50" 跳出循环} ofs tream file ("aaa .txt" );f or(in t i=0 ;i<10 ;i++) {fi it

c学生信息管理系统 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数7
  • 收藏数0 收藏
  • 顶次数0
  • 上传人mbswu24jy9
  • 文件大小55 KB
  • 时间2017-05-24