Centribandis
4 год назад
перевести код программы с паскаля на пайтон program vlad2;uses crt;vara,b,c:integer;beginwrite('a='); //ввод переменой areadln(a);write('b=');//ввод переменой breadln(b);write('c=');//ввод перменой сreadln(c);beginif ((a+b) mod 2=0) thenwrite('a+b');if ((a+c) mod 2=0) thenwrite('a+c');if ((b+c) mod 2=0) thenwrite('b+c');end;end.
ОТВЕТЫ
Williamson Francis
Oct 24, 2020
a = int(input("a="))
b = int(input("b="))
c = int(input("c="))
if (a+b) % 2 == 0 :
print("a+b")
if (a+c) % 2 == 0 :
print("a+c")
if (b+c) % 2 == 0 :
print("b+c")
"mod" => "%"
"=" => "==" в сравнениях
"then" => ":"
13
Смежные вопросы: