#include<iostream>
using namespace std;
class exam{
public:
exam(int n,int s)
{
number=n;
score=s;
}
void get_x()
{
cout<<number<<' '<<score<<endl;
}
private:
int number;
int score;
};
int main()
{
exam ob1[6]={
exam(1,60),
exam(2,90),
exam(3,70),
exam(4,80),
exam(5,30),
exam(6,99)
};
for(int i=0;i<6;i++)
if(i%2!=0)
ob1[i].get_x();
system("pause");
return 0;
}
4.17
最新推荐文章于 2024-04-17 23:35:34 发布