标签:des blog io os ar for sp 数据 div
01 89 02 78 03 56 04 92 05 76
04 92
#include <iostream> using namespace std; class student { public: char no[100]; int score; }; student a[5]; void max(student *&p) { int i; int max=a[0].score; for(i=1; i<5; i++) { if(a[i].score > max) { max=a[i].score; p = &a[i]; } } } int main() { int i; for(i=0; i<5; i++) cin>>a[i].no>>a[i].score; student *p=&a[0]; max(p); cout<<p->no<<" "<<p->score<<endl; return 0; }
标签:des blog io os ar for sp 数据 div
原文地址:http://blog.csdn.net/u013634961/article/details/40073441