Advertisement
STANAANDREY

R.11.5 buletin

Nov 5th, 2019
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. typedef struct
  6. {
  7.     char nume[100];
  8.     unsigned zi;
  9.     int p, temp;
  10. } BUL;
  11.  
  12. int main()
  13. {
  14.     BUL b[100];
  15.     int n, maxitemp = -1e3;
  16.     cin >> n;
  17.     for (int i = 0; i < n; i++)
  18.     {
  19.         getchar();
  20.         gets(b[i].nume);
  21.         cin >> b[i].p >> b[i].temp;
  22.         b[i].zi = i + 1;
  23.         if (maxitemp < b[i].temp)
  24.             maxitemp = b[i].temp;
  25.     }
  26.  
  27.     cout << "temperatura maxima:" << maxitemp << endl;
  28.     for (int i = 0; i < n; i++)
  29.     {
  30.         if (maxitemp == b[i].temp)
  31.             cout << b[i].zi << ' ' << b[i].nume << endl;
  32.     }
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement