#include
#include
#include
using namespace std;
int main() {
double b[100][100];
int m,n;
cout << "m = ";<br> cin >> m;
cout << "n = ";<br> cin >> n;
double min, s=0;
srand(time(0));
for (int i = 0; i < m; i++){
for (int j = 0; j < n; j++){
b[i][j]=-20 + (101.0 / RAND_MAX) * rand();
cout << fixed << setw (7) << setprecision (2) << b[i][j];<br> }
cout <<endl;<br> }
for (int i = 0; i < m; i++){
min = b[i][0];
for (int j = 1; j < n; j++)
if (b[i][j] s+=min;
}
cout << "s = " << s << endl;<br>}
Пример:
m = 4
n = 5
13.22 57.79 50.37 28.83 8.94
48.01 32.86 -16.49 -5.80 67.08
15.84 26.60 42.95 -0.34 46.37
10.89 -3.28 0.48 -11.50 77.09
s = -19.39