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 <math.h>
const double g = 9.08665;
int main() {
unsigned int h;
std::cout << "Enter height of tree :" ;
std::cin>> h;
if (std::cin.fail()) // если предыдущее извлечение оказалось неудачным,
{
std::cin.clear();
std::cin.ignore(32767,'\n');
std::cout << "Please die";
return 2;
}
if(h == 0) {
std::cout<<"You are stupid! Apple is on the earth\n";
return 1;
}
std::cout<<"Program is thinking, but you no!\n";
double t = sqrt(2 * h / g);
std::cout << "Time is " << t << "\n";
std::cout << "Goodbye asshole\n";
return 0;
}
Объяснение:
Надеюсь, тебе не поставят два за это
Замени мои матные выражения в "" и можешь сдавать
100
101
102
103
110
111
112
113
120
121
122
123
130
131
132
133
200
201
202
203
210
211
212
213
220
221
222
223
230
231
232
233
300
301
302
303
310
311
312
313
320
321
322
323
330
331
332
333