linvliv
12.09.2022 23:23

Составить программу на языке C++


Составить программу на языке C++

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Aminka26
15.05.2023 19:30

a = float(input("Введите первое число: "))

b = float(input("Введите второе число: "))

c = input("Введите действие: ")

if c == "+":

   print(a + b)

elif c == "-":

   print(a - b)

elif c == "/":

    if b == 0:                    

        print("Деление на 0!")

    else:

        print(a / b)

elif c == "*":

   print(a * b)

elif c == "mod":

   if b == 0:                      

       print("Деление на 0!")

   else:                          

       print(a % b)                

elif c == "pow":

   print(a ** b)

elif c == "div":

   if b == 0:

       print("Деление на 0!")      

   else:                                  

       print(a // b)  

0,0(0 оценок)
Ответ:
LugovoyDanila
15.12.2022 10:42

def print_friends_count(friends_count):

   if friends_count < 100:

       print(f'У вас {friends_count} друзей')

   elif friends_count < 1000:

       print(f'У вас {friends_count} друзей')

   else:

       print(f'У вас {friends_count} друзей')

print_friends_count(0)

print_friends_count(1)

print_friends_count(99)

print_friends_count(100)

print_friends_count(101)

print_friends_count(999)

print_friends_count(1000)

print_friends_count(1001)

print_friends_count(9999)

print_friends_count(10000)

print_friends_count(10001)

print_friends_count(99999)

print_friends_count(100000)

print_friends_count(100001)

print_friends_count(999999)

print_friends_count(1000000)

print_friends_count(1000001)

print_friends_count(9999999)

print_friends_count(10000000)

print_friends_count(10000001)

print_friends_count(99999999)

print_friends_count(100000000)

print_friends_count(100000001)

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота