| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1236 人关注过本帖
标题:急啊 大家给看看哪里错了 怎么跳过语句啊
取消只看楼主 加入收藏
fuyaosuixin
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-12-9
收藏
 问题点数:0 回复次数:0 
急啊 大家给看看哪里错了 怎么跳过语句啊
include <iostream>
#include <fstream>
using namespace std;
struct Student1{
      int num;
      char name[32];
      float fScore[3];
      float fAverage;
};

int main(){
   int i,j=0,d=0;
    struct Student1 * stud1=new Student1;
    ofstream output("c:/StudInfo.txt",ios::out);
    output.unsetf(ios::skipws);
    while(1)
    {cout<<"input 0 Exit";
    cin>>d;
    cout<<"请输入基本信息 编号 姓名";
    if(d==0)break;
   
    j++;
    cin>>stud1->num>>stud1->name;
    cout<<"输入三科成绩";
    for(i=0;i<3;i++)
    {cin>>stud1->fScore[i];}
    cin>>stud1->fAverage;
    output.write((char *)stud1,sizeof(Student1));
    }
    
    ifstream input("c:/StudInfo.txt",ios::in);
    input.unsetf(ios::skipws);
    i=0;
    while(i<j)
    {i++;
    input.read((char *)stud1,sizeof(stud1));
    cout<<stud1->num<<ends<<stud1->name<<ends;
    for(i=0;i<3;i++)
    {cout<<stud1->fScore[i]<<ends;}
    cout<<stud1->fAverage<<endl;  
    }
input.close();  output.close();
return 0;
}

cout<<"请输入基本信息 编号 姓名"; 这一句怎么不执行啊
 if(d==0)break; 放在它下面也不行 大家给看看
搜索更多相关主题的帖子: 语句 int ios float 
2008-01-03 22:54
快速回复:急啊 大家给看看哪里错了 怎么跳过语句啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016887 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved