Nik_Perepelov

задача аааааа

Sep 16th, 2020
542
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. a = input()
  3. sum = 0
  4. for i in range(len(a)):
  5.     current_symbol = a[i]
  6.     sum *= n
  7.     if current_symbol.isdigit():
  8.         sum += int(current_symbol)
  9.     else:
  10.         sum += ord(current_symbol) - 65 + 10
  11. print(sum)
  12.  
RAW Paste Data