Program project1; uses crt,math; var s:real; i,j,f:real; a:integer; begin writeln('vvedite 1 chislo ');readln(i); writeln('vvedite 2 chislo ');readln(j); writeln('vvedite 3 chislo ');readln(f); s:=i; if j<s then s:=j; if f<s then s:=f; if s<0 then begin if i<0 then inc(a); if j<0 then inc(a); if f<0 then inc(a); writeln('kolichestvo otricatelnix ',a:2); end else begin if i>0 then i:=i*-1; if j>0 then j:=i*-1; if f>0 then f:=i*-1; end; writeln('min chislo ',s:2:0); readln; end.
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector< vector<int> > arr;
arr.resize(8);
for (int i = 0; i < 8; ++i) {
arr[i].resize(7);
}
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 7; ++j) {
arr[i][j] = rand();
cout << arr[i][j] << " ";
if (j == 6) {
cout << endl;
}
}
}
swap(arr[3], arr[0]);
swap(arr[4], arr[7]);
cout << endl;
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 7; ++j) {
cout << arr[i][j] << " ";
if (j == 6) {
cout << endl;
}
}
}
}