ответ: ок я програмист со стажем
Объяснение:
user = "імя"
action = "школа"
log_message = 'Пользователь {} зашел на сайт и выполнил действие: {}'.format(
user,
action
)
print(log_message)
# Пользователь імя зашел на сайт и выполнил действие: школа
from dataclasses import dataclass
@dataclass
class Armor:
armor: float
description: str
level: int = 1
def power(self) -> float:
return self.armor * self.level
armor = Armor(5.2, "Common armor.", 2)
armor.power()
# 10.4
print(armor)
# Armor(armor=5.2, description='Common armor.', level=2)
#include <iostream>
#include <cmath>
using namespace std;
signed main() {
int n;
cin >> n;
double a[n];
for(int i = 0; i < n; i++)
cin >> a[i];
double mx = -10000000000000;
for(int i = n/2; i < n; i++)
mx = max(mx,a[i]);
for(int i = 0; i < n-1; i++)
for(int j = 0; j < n - i - 1; j++)
if(a[j] > a[j+1])
{
double temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
cout << "maximal element of the second half: " << mx <<"\n";
cout << "array after sorting: " << "\n";
for(auto i: a)
cout << i << " ";
}