Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1. #include <stdio.h>
  2. int main ()
  3. {
  4.     int a[100][100],i,j,m,n;
  5.     scanf("%d%d",&n,&m);
  6.     for(i=0;i<n;i++)
  7.     {
  8.         for(j=0;j<m;j++)
  9.         {
  10.             scanf("%d",&a[i][j]);
  11.         }
  12.     }
  13.  
  14.     for(i=0;i<n;i++)
  15.     {
  16.         for(j=0;j<m;j++)
  17.         {
  18.             printf("%d ",a[i][j]);
  19.         }
  20.         printf("\n");
  21.     }
  22. int prz1,prz2;
  23.     for(i=0;i<n;i++)
  24.     {
  25.         prz1[i]=1;
  26.         prz2[i]=1;
  27.     }
  28.  
  29.     for(i=0;i<n;i++)
  30.     {
  31.         for(j=0;j<m;j++)
  32.         {
  33.             if(j<m/2)
  34.             {
  35.                 prz1=prz1*a[i][j];
  36.             }
  37.             if(j>m/2)
  38.             {
  39.                 prz2=prz2*a[i][j];
  40.             }
  41.         }
  42.     }
  43.     if(prz1>prz2)
  44.     {
  45.         a[i][j]=a[i][n-j-1];
  46.     }
  47.  
  48.     for(i=0;i<n;i++)
  49.     {
  50.         for(j=0;j<m;j++)
  51.         {
  52.             printf("%d",a[i][j]);
  53.     printf("\n");
  54.         }
  55.     }
  56.     return 0;
  57.  
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement