Bob103

Для Елизаветы

Feb 24th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. using namespace std;
  4. void main()
  5. {
  6. int N, M, i, j;
  7. int FlagMas[20];
  8. int mas[20][20], Max, Min;
  9. printf("Enter N and M: ");
  10. scanf_s("%i", &N);
  11. scanf_s("%i", &M);
  12. printf("Enter matrix \n");
  13. for (i = 0; i<N; i++)
  14. {
  15. FlagMas[i] = 1;
  16. for (j = 0; j<M; j++)
  17. {
  18. scanf_s("%i", &mas[i][j]);
  19. if (mas[i][j] % 2 != 0) FlagMas[i] = 0;
  20. }
  21. }
  22. printf("%c", '\n');
  23. for (i = 0; i<N; i++)
  24. {
  25. if (FlagMas[i] == 0)
  26. for (j = 0; j<M; j++) printf("%i ", mas[i][j]);
  27. else
  28. for (j = M - 1; j >= 0; j--) printf("%i ", mas[i][j]);
  29. printf("%c", '\n');
  30. }
  31. _getch();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment