dndzanton
21.11.2022 01:14

Как сократить время работы в питоне 30

a = int(
l = []
f = 0
m = []
mas = [int(el) for el in
for el in mas:
if el < 0:
el = el * -1
f += 1
l.append(el)
else:
l.append(el)
for i in range(f):
m.append(min(l) * -1)
l.remove(min(l))
print(sum(m) + sum(l))

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
asya13051
09.07.2022 17:25
1)
Program lapy;
var lapy:integer;
Begin
  Writeln('Сколько лап?');
  Readln(lapy);
  If lapy=0 then Writeln('Это рыба');
  if lapy=2 hten Writeln('Это птица');
  if lapy=4 then Writeln('Это лось');
  if lapy=6 then Writeln('Это жук');
  if lapy=8 then Writeln('Это паук');
end.
2)
Program kinotheatr;
var mesto:integer;
Begin
  Writel('Укажите Ваше место:');
  Readln(mesto);
  if (mesto>=1) and (mesto<=10) then Writeln('Цена 150р.');
  if (mesto>=11) and (mesto<=15) then Writeln('Цена 100р.');
  if (mesto>=16) and (mesto<=20) then Writeln('Цена 75р.');
End.
0,0(0 оценок)
Ответ:
RownBitter
09.02.2020 11:20

using System;

class Program

   {

       static void Main(string[] args)

       {

           Console.WriteLine("Введите координату x точки");

           double x = int.Parse(Console.ReadLine());

           Console.WriteLine("Введите координату y точки");

           double y = int.Parse(Console.ReadLine());

           Console.WriteLine("Введите радиус");

           double r = int.Parse(Console.ReadLine());

 

           double d = Math.Sqrt(Math.Pow(-x, 2) + Math.Pow(-y, 2));

           Console.WriteLine(d);

           if (d < r){

               Console.WriteLine("Да");}

           else if (d == r){

               Console.WriteLine("На границе");}

           else{

               Console.WriteLine("Нет");}

           Console.ReadKey();

       }

   }

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