Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PTaHHHa
#include<stdio.h> #include<conio.h> #include<math.h> #include<stdlib.h> int main() { int i, j, size, jmin=0, imax=0, multip=0, **Massiv; printf("\n Vvedite razmer massiva: "); scanf_s("%d", &size); Massiv = (int **)malloc(size * sizeof(int*)); for (i = 0; i < size; i++) { Massiv[i] = (int*)malloc(size * sizeof(int)); } for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { printf("\n Massiv[%d][%d]= : ",i,j); scanf_s("%d", &Massiv[i][j]); } } int min = Massiv[0][0], max = Massiv[0][0]; for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { if (Massiv[i][j] < min) { min = Massiv[i][j]; jmin = j; } if (Massiv[i][j] > max) { max = Massiv[i][j]; imax = i; } } } for (i = 0; i < size; i++) { multip += Massiv[imax][i] * Massiv[i][jmin]; } printf("\n Rezultat ymnojeniya = %d", multip); for (i = 0; i < size; i++) { free(Massiv[i]); } free(Massiv); return 0; }
run
|
edit
|
history
|
help
0
delete from list
StreamParam
accessibility on in-class typedefs
ria
Calculate sum between two numbers using for-, while-, and do-while loops
#21.2
Regex pipe and tabs c++
1
Is min defined?
Implements.cpp