1 задача:
import math
a=int(input())
b=int(input())
if(math.fabs(a+b)>20):
print(math.pow(a,2))
else:
b=math.fabs(b)
print(math.sqrt(b))
2 задача:
a=int(input())
if a == 5:
print("Отлично")
elif a == 4:
print("Хорошо")
elif a == 3:
print("Удовлетворительно")
elif a == 2:
print("Плохо")
elif a == 1:
print("Отвратительно")
else:
print("Это не оценка")
3 задача:
x=int(input())
y=int(input())
a=int(input())
b=int(input())
a7 = a%x
b7 = b%y
if(a7>b7):
print("7A")
else:
print("7Б")
4 задача:
import math
print("Введите интервал")
a=int(input())
b=int(input())
while(a<=b):
if a<100:
r=13*math.pow(a,2)
print("X=" + str(a) + " y=" + str(r))
elif a>100:
r=math.pow(a,3)-100
print("X=" + str(a) + " y=" + str(r))
else:
r=30-(a/(a-5))
print("X=" + str(a) + " y=" + str(r))
a=a+1
5 задача:
import math
print("Введите интервал")
a=int(input())
b=int(input())
while(a<=b):
if a<4:
r=3*a-7
print("X=" + str(a) + " y=" + str(r))
else:
r=5*math.pow(a,2)
print("X=" + str(a) + " y=" + str(r))
a=a+1
Объяснение:
#include <iostream>
#include <vector>
using namespace std;
int main(){
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
vector<vector<int>> a;
string s;
while(getline(cin, s)){
string cur = "";
vector<int> t;
for(int i = 0; i < s.length(); i++){
if(s[i] == ' '){
t.push_back(stoi(cur));
cur.clear();
}
else{
cur += s[i];
}
}
if(!cur.empty())
t.push_back(stoi(cur));
a.push_back(t);
}
for(auto &i : a){
for(auto &j : i)
cout << j << " ";
cout << "\n";
}
}