Решал на паскале.
Первая:
var i:integer; s:string; a:array[1..3] of integer; t.q,z: boolean;
begin
readln(i); q:=false; t:=false;
a[1]:=i mod 10;
a[2]:=i div 10 mod 10;
a[3]:=i div 10 div 10;
for i:=1 to 3 do
begin
if a[i]=4 then
q:=true;
if (a[i]=7) and (q=true) then t:=true;
if a[i]=7 then z:=true;
end;
if t=true then writeln('Vhodyat oba) else if (q=true) and (z=false) then writeln('Vhodit 4') else if (q=false) and (z=true) then writeln('Vhodut 7');
readln;
end.
Вторая:
var a,b,c,min:integer;
begin
min:=32000;
readln(a,b,c);
if a<min then min:=a; if b<min then min:=b; if c<min then min:=c;
writeln ('Minimalnoe - ',min);
readln;
end.
Третья:
var a,b,c:integer; x,y,d:real;
begin
readln(a,b,c);
d:=b*b-(4*a*c);
if d=0 then
begin
x:=(-b/2*a);
writeln('One root: ',x:0:0);
end;
if d>0 then
begin
x:=(-b+sqrt(d))/2*a;
y:=(-b-sqrt(d))/2*a;
if y>x then
writeln('Two roots: ',x:0:0,' ',y:0:0) else writeln('Two roots: ',y:0:0,' ',x:0:0);
end;
if d<0 then writeln('No roots');
readln;
end.:
#include <iostream>
#include <time.h>
using namespace std;
int main() {
int T[255][255];
int N, sum, mult;
cout << "Vvedite N = "; cin >> N;
cout << "***Random matrix***" << endl;
srand(time(NULL));
//Генерация массива
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
T[i][j] = rand() % 41 + (-20);
printf("%4.0d ", T[i][j]);
}
cout << endl;
}
//Сумма отрицательных над главной
sum = 0;
for (int i = 1; i < N; i++) {
for (int j = 0; j < N; j++){
if (j == i - 1) {
if (T[i][j] < 0){
sum = sum + T[i][j];
}
}
}
}
cout << "Summa = " << sum << endl;
//Произведение ненулевых под главной
mult = 1;
for (int i = 0; i < N; i++) {
for (int j = 1; j < N; j++) {
if (j == i + 1) {
if (T[i, j] != 0) {
mult = mult * T[i][j];
}
}
}
}
cout << "Proizvedenie = " << mult << endl;
system("pause");
return 0;
}