C++??????????????
???????????? ???????[ 2014/6/6 10:08:41 ] ????????C++ ???????? net
????C++?????????????????????????????????????÷??????????????о?????C???????ж???????????C++???棬??????????????????????????????????????塣
?????????????????????????飬???????????????????????????????飬????????????????????????′?????????????????á?
??????????裬???????????????????ID??Score????????????????100?????????????????????????????????????????????????????C++???????????????????????????????????????
????????????????
????????????????飬???????????????????????????????????????????????????????????????????????????????????????????
????--------------------?????????????????????-----------------
# include <iostream>
# include <string>
using namespace std;
const int Objarr_Number = 5;
class Student
{
public:
Student(string?? int);//??????
Student(); //??????????????
void Print(); //???????????
string ID;
int score;
};
Student::Student(string s?? int n)
{
ID = s;
score = n;
}
void Student::Print()
{
cout << "ID : "<< ID << " " << "Score: "<< score << endl;
}
int main(void)
{
Student stud[Objarr_Number] = {
Student("001"?? 90)??
Student("002"?? 94)??
Student("003"?? 70)??
Student("004"?? 100)??
Student("005"?? 60)??
};
int max = stud[0].score;
int i = 0;
int k = 0;
cout << "ID " << " " << "Score "<< endl;
for(i = 0; i< Objarr_Number; i++)
{
//?????????????
cout << stud[i].ID <<" " << stud[i].score << endl;
//?????????б??
if(stud[i].score > max)
{
k = i;
max = stud[i].score;
}
}
cout <<"-----------------------------"<<endl;
cout << "The Max Score is " ;
//?????????????
stud[k].Print();
cout << endl;
return 0;
}
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11