SHARE
TWEET

Untitled

a guest Mar 25th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5.     double M[3][3];
  6.     int i, j, L = 0;
  7.     char T[5];
  8.     double result = 0.0;
  9.    
  10.     scanf("%d", &L);
  11.     scanf("%s", &T);
  12.    
  13.     for(i=0; i<3; i++)
  14.         for(j=0; j<3; j++)
  15.         scanf("%lf", &M[i][j]);
  16.  
  17.     if(T[0] == 'S'){
  18.     for(i=1; i<=10; i++)
  19.         if(i<=5)
  20.             for(j=11; j>11-i; j--)
  21.             result += M[i][j];
  22.             else
  23.                 for(j=11; j>1; j--)
  24.                 result += M[i][j];
  25.                     printf("%.1lf\n", result);
  26.         } else if(T[0] == 'M')
  27.             result /= (144-12-12)/4;
  28.             printf("%.1lf\n", result);
  29.  
  30.     return 0;
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top