Advertisement
Lisaveta777

weather ?

Sep 1st, 2018
795
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #define YEAR 2
  3. #define MONTH 5
  4.  
  5. int main()
  6. {
  7.     int y,m,total;
  8.     int weather[YEAR][MONTH] = {{1,2,3,4,5},{6,7,8,9,10}};
  9.     int y_weather[YEAR]={0};
  10.     int m_weather[MONTH]={0};
  11.    
  12.    
  13.  
  14.     for(y=0;y<YEAR;y++)
  15.     {
  16.  
  17.         for(m=0;m<MONTH;m++)
  18.         {
  19.             m_weather[m] = m_weather[m]+weather[y][m];
  20.         }
  21.         printf("m_weather[%d] is %d\n",m,m_weather[m]);
  22.     }
  23.  
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement