| 发表于:2007-05-12 12:31:00 楼主 |
#include <iostream> #include <string> #include <fstream> using namespace std; int main() { string xm,xb,sr,mz,gj,xl,csrq,jtzz,xh,yw,yy,sx,wl,sjhm,jtdh,xxdh,bxm; cout < < "********************添加一个学生信息******************* " < <endl; cout < < "下面输入个人信息: " < <endl; cout < < "请输入姓名: " < <endl; cin> > xm; cout < < "请输入性别 " < <endl; cin> > xb; cout < < "请输入生日(格式举例:1982-1-1): " < <endl; cin> > sr; cout < < "请输入民族: " < <endl; cin> > mz; cout < < "请输入国籍: " < <endl; cin> > gj; cout < < "请输入学历: " < <endl; cin> > xl; cout < < "请输入家庭住址: " < <endl; cin> > jtzz; cout < < "编辑个人信息完成! " < <endl; cout < < "姓名: " < <xm < <endl; cout < < "性别: " < <xb < <endl; cout < < "民族: " < <mz < <endl; cout < < "国籍: " < <gj < <endl; cout < < "出生日期: " < <sr < <endl; cout < < "家庭住址: " < <jtzz < <endl; bxm=xm; bxm += "a.txt "; ofstream outobj(bxm); outobj < <xm < < ' ' < <xb < < ' ' < <mz < < ' ' < <gj < < ' ' < <sr < < ' ' < <jtzz; cout < < "下面输入学科成绩: " < <endl; cout < < "请输入学号: " < <endl; cin> > xh; cout < < "请输入大学语文成绩: " < <endl; cin> > yw; cout < < "请输入英语成绩: " < <endl; cin> > yy; cout < < "请输入数学成绩 " < <endl; cin> > sx; cout < < "请输入物理成绩 " < <endl; cin> > wl; cout < < "编辑学科成绩完成! " < <endl; cout < < "学号: " < <xh < <endl; cout < < "大学语文成绩: " < <yw < <endl; cout < < "英语成绩: " < <yy < <endl; cout < < "数学成绩: " < <sx < <endl; cout < < "物理成绩: " < <wl < <endl; bxm=xm; bxm += "b.txt "; ofstream outob(bxm); outobj < <xh < < ' ' < <yw < < ' ' < <yy < < ' ' < <sx < < ' ' < <wl; cout < < "下面输入联系方式: " < <endl; cout < < "请输入手机号码: " < <endl; cin> > sjhm; cout < < "请输入家庭电话号码: " < <endl; cin> > jtdh; cout < < "请输入学校电话号码: " < <endl; cin> > xxdh; cout < < "手机号码是: " < <sjhm < <endl; cout < < "家庭电话是: " < <jtdh < <endl; cout < < "学校电话是: " < <xxdh < <endl; bxm=xm; bxm += "c.txt "; ofstream outo(bxm); outobj < <sjhm < < ' ' < <jtdh < < ' ' < <xxdh; return 0; } 谢谢 |
|
|
|
|