#include <iostream>
#include <type_traits>
#include <numbers>
const auto init = []() {
std::cout.setf(std::ios::fixed);
std::cout.precision(15);
return 'c';
}();
struct math {
static constexpr auto pi = std::numbers::pi;
};
template <typename T>
void print_arg(const T& arg) {
if constexpr (std::is_same_v<T, bool>) {
std::cout << (arg ? "TRUE" : "FALSE");
} else {
std::cout << arg;
}
}
void print() {
std::cout << '\n';
}
template<typename T, typename... Args>
void print(T first, Args... args) {
print_arg(first);
if constexpr (sizeof...(args) > 0) {
std::cout << " ";
print(args...);
} else {
std::cout << '\n';
}
}
// почти Python
int main() {
print("Hello world!");
auto x = 3;
print(x);
print("PI:", math::pi);
}
(пример на python)
print("hello world")
и
x = 3
print(x)
(если вы сможете то пожалуйста объясните)