问题及代码
#include <iostream>
#include<string>
using namespace std;
class Student
{
string number;
int c;
int m;
int e;
public:
Student(string n="1231",int a=89,int b=89,int c=89):number(n),c(a),m(b),e(c){}
void averag()
{
cout<<"student:"<<number<<endl;
cout<<(c+m+e)/3<<endl;
}
void pass()
{
if(c>59&&m>59&&e>59)
cout<<"pass"<<endl;
else
{
if(c<60)
cout<<"Chinese"<<endl;
if(m<60)
cout<<"Math"<<endl;
if(e<60)
cout<<"English"<<endl;
}
}
};
int main()
{
string name;
int c,m,e;
cin>>name>>c>>m>>e;
Student s(name,c,m,e);
s.averag();
s.pass();
return 0;
}
明明就是大小写的错误,它老是说什么
1c1< student:1001---> 10013c3< pass\ 文件尾没有 newline 字符---> pass
百度了说是什么少行,有又加 '\ r', 又加 endl, 结果还是错。。。。。
虽然说到底是我的错,但是原谅我我还是想抽它!!这小孩,不打不行。。
但是我还是感谢它让我有了百度的意识——虽然这次没用