Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- int main(int argc, char *argv[]) {
- int n, m;
- scanf("%d%d", &n, &m);
- int matrica[n][m];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- scanf("%d", &matrica[i][j]);
- }
- }
- for(int i = 0; i < n; i += 2) {
- for(int j = 0; j < m; j++) {
- if(i + 1 < n) {
- matrica[i][j] -= matrica[i + 1][j];
- }
- }
- }
- for(int i = 0; i < n; i += 2) {
- for(int j = 0; j < m; j++) {
- printf("%d ", matrica[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
- /*
- 1 0 2 4
- 3 3 23 5
- 3 5 5 6
- 0 3 12 7
- 1 7 0 12
- 3 3 4 3
- 1 7
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement