Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     double h[12][12], soma = 0, media;
  6.     char p;
  7.     cin >> p;
  8.     for(int i = 0; i < 12; i++){
  9.         for(int j = 0; j < 12; i++){
  10.             cin >> h[i][j];
  11.             if (i > j)
  12.             {
  13.                 soma = soma + h[i][j];
  14.             }
  15.         }
  16.     }
  17.     media = soma/66;
  18.     if (p == 'S')
  19.     {
  20.         printf("%.1f\n", soma);
  21.     }
  22.     else
  23.     {
  24.         printf("%.1f\n", media);
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement