Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- struct elev
- {
- char nume[20];
- float mate,ro;
- } c[35];
- int main()
- {
- int n, i;
- float maxim=0;
- cin>>n;
- for(i=1; i<=n;i++)
- {
- cin>>c[i].nume>>c[i].mate>>c[i].ro;
- }
- for(i=1; i<=n; i++)
- {
- if((c[i].mate+c[i].ro)/2>maxim)
- {
- maxim=c[i].mate+c[i].ro;
- }
- }
- cout<<maxim<<endl;
- for(i=1; i<=n; i++)
- {
- if((c[i].mate+c[i].ro)/2==maxim)
- {
- cout<<c[i].nume<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement