Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main ()
- {
- int a[100][100],i,j,m,n;
- scanf("%d%d",&n,&m);
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- scanf("%d",&a[i][j]);
- }
- }
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- printf("%d ",a[i][j]);
- }
- printf("\n");
- }
- int prz1,prz2;
- for(i=0;i<n;i++)
- {
- prz1[i]=1;
- prz2[i]=1;
- }
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- if(j<m/2)
- {
- prz1=prz1*a[i][j];
- }
- if(j>m/2)
- {
- prz2=prz2*a[i][j];
- }
- }
- }
- if(prz1>prz2)
- {
- a[i][j]=a[i][n-j-1];
- }
- for(i=0;i<n;i++)
- {
- for(j=0;j<m;j++)
- {
- printf("%d",a[i][j]);
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement