Объяснение:
На C++
#include <iostream>
#include <cmath>
int main(){
int x, y;
std::cin >> x;
if(x<=-20) {
y = 3*x*x*x;
} else {
if(x>-20 && x<=30) {
y = abs(x);
y = 30;
}
std::cout << x << std::endl;
return 0;
На Python 3:
import math as m
x = int(input())
if x<=-20:
y = 3*x**3
else:
if x>-20 and x>=30:
y = m.abs(x)
y = 30
print(x)
Объяснение:
На C++
#include <iostream>
#include <cmath>
int main(){
int x, y;
std::cin >> x;
if(x<=-20) {
y = 3*x*x*x;
} else {
if(x>-20 && x<=30) {
y = abs(x);
} else {
y = 30;
}
}
std::cout << x << std::endl;
return 0;
}
На Python 3:
import math as m
x = int(input())
if x<=-20:
y = 3*x**3
else:
if x>-20 and x>=30:
y = m.abs(x)
else:
y = 30
print(x)