Advertisement
machkovskitomche

matrici/ispitna

Aug 20th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int temperaturi[7][5],i,j,max;
  7.     printf("Vnesete gi elementite na 7x5 matricata: \n");
  8.     for(i=0;i<7;i++)
  9.     {
  10.         for(j=0;j<5;j++)
  11.         {
  12.             printf("Temperaturi[%d][%d]= ",i,j);
  13.             scanf("%d",&temperaturi[i][j]);
  14.         }
  15.     }
  16.     for(i=0;i<7;i++)
  17.     {
  18.         max=temperaturi[i][0];
  19.         for(j=0;j<5;j++)
  20.         {
  21.             if(temperaturi[i][j]>max)
  22.             {
  23.                 max=temperaturi[i][j];
  24.             }
  25.         }
  26.         printf("%d-tiot den ima %d temperatura.",i+1,max);
  27.     }
  28.     return 0;
  29. }
  30. //max temperatura za odreden den od nedelata,od 5 merenja
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement