veronikkot2016
03.03.2020 12:07

Задача "Шеренга". Подробнее на скрине


Задача Шеренга. Подробнее на скрине

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
kristy43rus
02.11.2021 12:15
#include <iostream>#include <string>using namespace std;int main() { system("chcp 1251"); string str; bool stringIsAllow = false; getline(cin, str); if (str.empty()) {  return -1; } else {  for (int i = 0; i < str.length(); i++)  {   if ((str[i] >= 65 && str[i] <= 90) ||    (str[i] >= 97 && str[i] <= 122) ||    (str[i] >= 48 && str[i] <= 57) ||    str[i] == 95) {    stringIsAllow = true;    continue;   }   else   {    cout << "Wrong symbol: " << str[i] << endl;    stringIsAllow = false;    break;   }  } } if (stringIsAllow) {  cout << "OK!" << endl; } return 0;}
0,0(0 оценок)
Ответ:
839010
16.10.2020 09:59

def reverse_order_of_number(x):

   if len(str(x)) == 5:

       test_list = []

       new_test_list = test_list

       for a in str(x):

           test_list.append(a)

       print('Before: {}'.format(test_list))

       i = 0

       while i < 2:

           i += 1

           p = test_list.pop()

           new_test_list.insert(0, p)

       print("After: {}".format(new_test_list))

   else:

       print('The number is not five-digit!')

numbers = int(input("Enter a five-digit number: "))

reverse_order_of_number(numbers)

reverse_order_of_number(54321)

reverse_order_of_number(543)

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