//з № 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.
Объяснение:
#include <iostream>
#include <vector>
#include <set>
#include <cmath>
using namespace std;
bool check(double a, double b, double c){
return !(a >= b + c || b >= a + c || c >= b + c);
}
double square(double a, double b, double c){
double p = (a+b+c)/2;
return sqrt(p * (p-a) * (p-b) * (p-c));
}
bool is_palind(int k){
string s = to_string(k);
for(int i = 0; i < s.length() - i - 1; i++)
if(s[i] != s[s.length()-i-1])
return false;
return true;
}
void solve1(){
vector<double> lines(4);
double ans = -1;
for(auto &i : lines) cin >> i;
for(int i = 0; i < 4; i++)
for(int j = i + 1; j < 4; j++)
for(int k = j + 1; j < 4; j++)
if(check(lines[i],lines[j],lines[k]))
ans = max(ans,square(lines[i],lines[j], lines[k]));
ans == -1 ? cout << "No solution" : cout << ans;
}
void solve2(){
set<int> s;
for(int i = 1000; i < 10000; i++)
if(is_palind(i))
s.insert(i);
int n;
cin >> n;
s.find(n) != s.end() ? cout << n : cout << *upper_bound(s.begin(),s.end(),n);
}