PhotoShaman

Untitled

Dec 26th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. #include <iostream>
  2. #include <clocale>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. void main()
  8. {
  9.     setlocale(LC_ALL, "Russian");
  10.     int sum = 0, max = 0;
  11.     int A[8][5];
  12.     for (int i = 0; i < 8; i++)
  13.     {
  14.         for (int j = 0; j < 5; j++)
  15.         {
  16.             cout << "Спортесмен: " << i + 1 << endl << "Балов за " << j + 1 << " вид спорта : ";
  17.             cin >> A[i][j];
  18.  
  19.         }
  20.     }
  21.  
  22.     cout << "|Спортсмен| 1 | 2 | 3 | 4 | 5 |" << endl;
  23.     cout << "|-----------------------------|";
  24.     for (int i = 0; i < 8; i++)
  25.     {
  26.         sum = 0;
  27.         cout << endl;
  28.         cout << "|     " << i + 1 << "   |";
  29.  
  30.         for (int j = 0; j < 5; j++)
  31.         {
  32.             cout << " " << A[i][j] << " |";
  33.         }
  34.         for (int k = 0; k < 5; k++)
  35.         {
  36.             if (max < A[i][k])
  37.             {
  38.                 max = A[i][k];
  39.             }
  40.             sum = sum + A[i][k];
  41.         }
  42.         cout << " Crednyaa " << sum / 5;
  43.  
  44.         cout << endl << "|-----------------------------|";
  45.        
  46.     }
  47.     cout << " Maximalnaya ocenka " << max;
  48.     cin.get(); cin.get();
  49. }
Advertisement
Add Comment
Please, Sign In to add comment