<span>Одну и ту же информацию можно кодировать разными способами. Например, русский текст мы привыкли записывать с помощью русского алфавита. Этот же текст можно записать латинскими буквами или используя азбуку Морзе.</span>
Решения находятся в приложениях.
Красным цветом показаны результаты выполнения алгоритмов.
<h3>1)</h3>
a = input()
b = input()
answ = ((a*a)+(b*b))
print(answ)
answ = (a**3)*(b**3)
print(answ)
<h3>2)</h3>
r = float(input("Радиус круга: "))
p = 3.14
print(r*r*p)
print(2*p*r)
<h3>3)</h3>
a, b, c = map(int, input().split())
if b >= a <= c:
print(a)
elif a >= b <= c:
print(b)
else:
print(c)
<h3>4)</h3>
<em>не забывай про табуляции</em>
def dog():
out = 0
years = int(input())
if (years <= 2):
out = years * 10.5
return out
elif (years > 2):
while(years != 2):
out += 4
years -= 1
out += 2 * 10.5
return out
def cat():
out = 0
years = int(input())
if (years <= 2):
out = years * 12.5
return out
elif (years > 2):
while(years != 2):
out += 4
years -= 1
out += 2 * 12.5
return out
if __name__ == '__main__':
pet = input()
if(pet == "собака"):
print(dog())
if(pet == "кошка"):
print(cat())
<h3>5)</h3>
со вложенными ничего не придумал
def letdothatprint():
lenght = 5
high = 7
print("* " * lenght) #Just top
while (high != 1):
print((lenght-1) * " " + "*")
high -= 1
if __name__ == '__main__':
letdothatprint()
№1
#include <iostream>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
for (int i=a; i<=b; ++i) if (i%3==0) cout<<i<<" ";
}
№2
#include <iostream>
using namespace std;
int main(){
int a, b, s=0;
cin>>a>>b;
for (int i=a; i<=b; ++i) if (i%2==1) s+=i;
cout<<s;
}
№3
#include <iostream>
using namespace std;
int main(){
for (int i=10; i<=20; ++i) cout<<i*i<<" ";
}
Const
s='информатика';
var
s1:string;
begin
s1:=s; Delete(s1,1,2); Delete(s1,7,3);
Writeln(s1);
s1:=s; Delete(s1,1,1); Delete(s1,2,1); Delete(s1,3,3); Delete(s1,4,2);
Writeln(s1)
end.