Не очень понятно, особенно 2 задача. Сам поставил между скобками логическое умножение?
11001111 10111100 10110000
Даны 4 целых числа. Найти сумму max и min.
def max(x, y):
if x > y:
return x
else:
return y
def min(x, y):
if x < y:
return x
else:
return y
print("Введите 4 числа:")
a = int(input())
b = int(input())
c = int(input())
d = int(input())
m1 = max(max(a,b),max(c,d))
m2 = min(min(a,b),min(c,d))
print("max = ",m1)
print("min = ",m2)
s = m1+m2
print("s = ",s)
Пример:
Введите 4 числа:
75
91
24
70
<span>max = 91
min = 24
s = 115</span>
using System;
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
bool f;
double a,b,c, s, s1;
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
s = Math.Sqrt(((a + b + c) / 2) * (((a + b + c) / 2) - a) * (((a + b + c) / 2) - b) * (((a + b + c) / 2) - c));
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
s1= Math.Sqrt(((a + b + c) / 2) * (((a + b + c) / 2) - a) * (((a + b + c) / 2) - b) * (((a + b + c) / 2) - c));
if (s == s1)
f = true;
else
f = false;
Console.WriteLine(f);
Console.ReadKey();
}
}
}
Ответ:
2 единицы
643
A1B
Объяснение:
Сколько единиц в двоичной записи числа 65? - 100 0001 - 2 единицы
1A3(16) - это 643(8) или 419 (10)
101000011011(2) - A1B(16)