#include <iostream> #include <string> using namespace std; class Student{ int grade; string name; public: static int num; Student(){ grade=0; name="123"; } Student(string b,int a):grade(a),name(b){} ~Student(){} friend istream &operator>>(istream &input,Student &st)//必须是friend { input >> st.name>> st.grade ;num++; return input; } friend ostream &operator<<(ostream &output,Student &st) { output<<st.num<<'.'<<' '<<st.name<<' '<<(st.grade>=60? "PASS":"FAIL"); return output; } }; int Student::num=0; int main(){ int i, repeat; Student st; cin>>repeat; for(i=0;i<repeat;i++){ cin>>st; cout<<st<<endl; } return 0; }