Skip to content

Instantly share code, notes, and snippets.

# -*- encoding: cp1251 -*-
from math import * # импортировать всё из math, чтобы каждый раз не писать math.sqrt и т.д.
# стр 21 - I 2
x = float(input("Введите x: "))
y = float(input("Введите y: "))
print("Результат выражения:", exp(-x)-cos(x)+sin(2*x*y))
# стр 21 - II 3
from multiprocessing.pool import ThreadPool
from six.moves import urllib
def fetch_url(url):
html = urllib.request.urlopen(url)
if 'yadi.sk' in html.read().decode('utf-8'):
return url
urls = ["https://goodgame.ru/user/{0!s}/".format(i) for i in range(1, 9999999)]
results = ThreadPool(100).imap_unordered(fetch_url, urls)
#include "base64.h"
#include <iostream>
#include <windows.h>
int main() {
const std::string s = "Димас - ананас";
SetConsoleOutputCP(1251);
std::string encoded = base64_encode(reinterpret_cast<const unsigned char*>(s.c_str()), s.length());
std::string decoded = base64_decode(encoded);