TypeCast/zelgades | TypeCast/Dstamplevskiy1 | ||||
---|---|---|---|---|---|
f | 1 | import sys | f | 1 | import sys |
2 | from functools import wraps | 2 | from functools import wraps | ||
3 | 3 | ||||
4 | 4 | ||||
t | 5 | def cast(t): | t | 5 | def cast(typ): |
6 | def decorator(func): | 6 | def wrapper(fun): | ||
7 | @wraps(func) | 7 | @wraps(fun) | ||
8 | def casted(*args, **kwargs): | 8 | def func(*args, **kwargs): | ||
9 | return t(func(*args, **kwargs)) | 9 | return typ(fun(*args, **kwargs)) | ||
10 | return casted | 10 | return func | ||
11 | return decorator | 11 | return wrapper | ||
12 | 12 | ||||
13 | 13 | ||||
14 | exec(sys.stdin.read(), globals()) | 14 | exec(sys.stdin.read(), globals()) | ||
15 | 15 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|