Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- int main(int argc, const char * argv[]) {
- int red, kolona;
- scanf("%d%d", &red, &kolona);
- double mat[red][kolona];
- for(int i = 0; i < red; i++) {
- for(int j = 0; j < kolona; j++) {
- scanf("%lf", &mat[i][j]);
- }
- }
- for(int j = 0; j < kolona; j++) {
- double najmal = mat[0][j];
- for(int i = 0; i < red; i++) {
- if(mat[i][j] < najmal) {
- najmal = mat[i][j];
- }
- }
- for(int i = 0; i < red; i++) {
- mat[i][j] = mat[i][j] / najmal;
- }
- }
- for(int i = 0; i < red; i++) {
- for(int j = 0; j < kolona; j++) {
- printf("%.2f ", mat[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement