Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- using namespace std;
- void main()
- {
- int N, M, i, j;
- int FlagMas[20];
- int mas[20][20], Max, Min;
- printf("Enter N and M: ");
- scanf_s("%i", &N);
- scanf_s("%i", &M);
- printf("Enter matrix \n");
- for (i = 0; i<N; i++)
- {
- FlagMas[i] = 1;
- for (j = 0; j<M; j++)
- {
- scanf_s("%i", &mas[i][j]);
- if (mas[i][j] % 2 != 0) FlagMas[i] = 0;
- }
- }
- printf("%c", '\n');
- for (i = 0; i<N; i++)
- {
- if (FlagMas[i] == 0)
- for (j = 0; j<M; j++) printf("%i ", mas[i][j]);
- else
- for (j = M - 1; j >= 0; j--) printf("%i ", mas[i][j]);
- printf("%c", '\n');
- }
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment