Давай сравним все 4 числа между собой, найдём максимальное и вычтем из него N.
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d, n;
cin >> a >> b >> c >> d >> n;
if (a > b && a > c && a > d)
a -= n;
else if (b > a && b > c && b > d)
b -= n;
else if (c > a && c > b && c > d)
c -= n;
else d -= n;
cout << a << " " << b << " " << c << " " << d << endl;
return 0;
}
//з № 1var s,d,f,max:integer;beginRead(s,d,f);if (s > d)and (s > f) thenmax:= selse if (d > s) and (d > f) thenmax:= delse if (f > d) and(f > s) then max:=f;write('max ',max);end.
//з № 2 var x:real; r:integer;beginwrite('Введите число x =');Read(x);if Frac(x)=0 then beginwriteln('x - целое число!');r:=round(x);if ((r mod 2)=0) then writeln('Число четное')else writeln('Число нечетное');endelse writeln('x - дробное число!')end.
//з № 3var a:integer;beginwrite('Введите число а =');Read(a);if (a > 0)and (a <= 5) thena:= a *a*aelse if (a > 5) thena:= a*aelsea:=a;write('a = ',a);end.
Объяснение: