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 n, m;
- scanf("%d%d", &n, &m);
- double matrica[n][m];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- scanf("%lf", &matrica[i][j]);
- }
- }
- double x;
- scanf("%lf", &x);
- for(int i = 0; i < n; i++) {
- int dali_e_ispecatena_redicata = -1;
- for(int j = 0; j + 1 < m; j++) { // ne smeeme da go proverime poslednata kolona bidejki taa nema sosed na desno
- if(fabs(matrica[i][j] - matrica[i][j + 1]) > x) {
- if(dali_e_ispecatena_redicata == -1) {
- printf("redica %d kolona ", i);
- dali_e_ispecatena_redicata = 1;
- }
- printf("%d ", j + 1);
- }
- }
- if(dali_e_ispecatena_redicata == 1) {
- printf("\n");
- }
- }
- return 0;
- }
- /*
- 4 4
- 1.7 2.0 10.1 0.5
- 7.3 2.2 3.4 1.01
- 6.0 5.1 5.2 4.1
- 4.4 1.0 0.0 1.2
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement