time limit: 1000ms
memory limit: 65536kb
submit
statistic
problem description
建立物件陣列,內放5個學生資料(學號是字串型別、成績是整型),設立max函式,用指向物件的指標作函式引數,在max函式中找出5個學生中成績最高者,並輸出其學號和成績。
input
輸入5個學生資料。
output
輸出5個學生中成績最高者的學號和成績。
example input
01 8902 78
03 56
04 92
05 76
example output
04 92
#include #include using namespace std;
class point
;void point::get(char ch,int s)
void print(point &t)
}cout<>ch>>s;
stu[i].get(ch,s);
}print(stu[0]);
return 0;
}
物件導向程式設計上機練習九(物件指標)
time limit 1000ms memory limit 65536kb submit statistic problem description 建立物件陣列,內放5個學生資料 學號是字串型別 成績是整型 設立max函式,用指向物件的指標作函式引數,在max函式中找出5個學生中成績最高者,並輸...
物件導向程式設計上機練習九(物件指標)
problem description 建立物件陣列,內放5個學生資料 學號是字串型別 成績是整型 設立max函式,用指向物件的指標作函式引數,在max函式中找出5個學生中成績最高者,並輸出其學號和成績。input 輸入5個學生資料。output 輸出5個學生中成績最高者的學號和成績。example...
物件導向程式設計上機練習九(物件指標)
time limit 1000ms memory limit 65536kb statistic problem description 建立物件陣列,內放5個學生資料 學號是字串型別 成績是整型 設立max函式,用指向物件的指標作函式引數,在max函式中找出5個學生中成績最高者,並輸出其學號和成績...