关键词:写代码
内容:读取成绩文件
A今日完成情况
1.读取成绩文件50%
内容:读取成绩文件
A今日完成情况
1.读取成绩文件50%
B具体内容
读取成绩文件
#include<iostream>
#include<fstream>
using namespace std;
float getscore(string filename,int stdno){
int stdno_temp;
float score;
ifstream in(filename.c_str()); //打开成绩文件
if(!in){ //判断文件是否打开正确
cout<<"文件打开错误" <<endl;
return 0;
}
}
bool flag=false;
while(in){
in>>stdno_temp>>score;
if(in){
if(stdno_temp==stdno){
flag=true;
break;
}
}
}
if(!flag){
}
int main()
{
ifstream in("info.txt"); //学生信息文件
ofstream out("student.txt"); //学生完整信息文件
if(!in||!out){
cout<<"文件打开错误"<<endl;
return 1;
}
}
C明日计划
A继续写