Created
October 13, 2016 21:02
-
-
Save Hajto/33876896233741da67546a780bef93fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
//Wersja L | |
int main(){ | |
int** matrix; | |
int width = 0; | |
int height = 0; | |
int counter = 0; | |
scanf("%d", &width); | |
scanf("%d", &height); | |
matrix = malloc(width * sizeof(int*)); | |
for(int i = 0; i < width; i++){ | |
matrix[i] = malloc(sizeof(int) * height); | |
for(int j = 0; j < height; j++){ | |
printf("line %d col %d\n",i,j); | |
double temp; | |
scanf("%f", &temp); | |
printf("Scanned:%f\n", temp); | |
matrix[i][j] = temp; | |
//matrix[i][j] = 0; | |
} | |
} | |
for(int i = 0; i < width; i++){ | |
for(int j = width - i; j <= height; j++){ | |
if(matrix[i][j] == 0){ | |
counter++; | |
} | |
printf("%d", matrix[i][j]); | |
} | |
printf("\n"); | |
} | |
for(int i = 0; i < width; i++){ | |
for(int j = 0; j < height; j++){ | |
printf("%d", matrix[i][j]); | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment