katyaDarsht
16.03.2023 21:26

Программирование на python ( 30 ! )
тема: работа со строками
1
вы находитесь в квест-комнате по мультфильму wall-e!
чтобы выбраться из комнаты, необходимо выполнить такие
шаги:
1. узнайте длину строки s текста и выведите
это значение в консоль.
2. выведите весь текст в нижнем регистре.
3. кто-то допустил ошибку и некорректно написал имя робота
wall-e! замените все вхождения слова walle на wall-e.
4. наконец, подсчитайте, сколько раз в тексте было исполь-
зовано слово earth.
код к 1:
s = "in a distant, but not so unrealistic, future \
where mankind has abandoned earth because it has \
become covered with trash from products sold by \
the powerful multi-national buy n large
corporation, \
walle, a garbage collecting robot has been left to \
clean up the mess. mesmerized with trinkets of
earth's \
history and show tunes, walle is alone on earth
except \
№ 7
2
for a sprightly pet cockroach. one day, eve, a
sleek \
(and dangerous) reconnaissance robot, is sent to
earth to \
find proof that life is once again sustainable."
# step 1
len()
# step 2
? .upper()
# step 3
? .replace(*, *, *)
# step 4
? .count()

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
lenokm050406
06.10.2022 01:07
Вот на С++:

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cstring>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <climits>typedef unsigned long long ulol;
typedef long double ld;
typedef long long lol;
typedef long int  li;#define mp          make_pair
#define F           first
#define S           second
#define sqr(a)      ( (a) * (a) )
#define pb          push_back
#define INF         999999999
#define ret(a)      cout << endl; system("pause"); return(a)
//#define ret(a)      return(a)using namespace std;int main()
{
    ld x;
    cin >> x;
    x = ( 8 / sqrt( x ) ) + sqrt(x);
    cout << x;
    ret(0);
}
0,0(0 оценок)
Ответ:
ДарьяГарушева11
28.02.2022 10:15
Var a1, b1, c1, a2, b2, c2, p1, p2, s1, s2: real;
begin
  writeln('Введите строны первого треугольника: ');
  read(a1, b1, c1);
  writeln('Введите стороны второго треугольника: ');
  read(a2, b2, c2);
  p1 := (a1 + b1 + c1) / 2;
  p2 := (a2 + b2 + c2) / 2;
  s1 := sqrt(p1 * (p1 - a1) * (p1 - b1) * (p1 - c1));
  s2 := sqrt(p2 * (p2 - a2) * (p2 - b2) * (p2 - c2));
  if (s1 + 1e-3 > s2) and (s1 < s2 + 1e-3) then writeln('Равновеликие')
                                           else writeln('Неравновеликие');
end.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота