# n = int(input())
# k = input().split()
#
# for i in range(n):
# k[i] = int(k[i])
#
# for i in range(n):
# print(str(i+1)+': ', end = '')
# for j in range(len(k)):
# if i == j:
# continue
# if k[i] < k[j]:
# print('<', end=' ')
# elif k[i] > k[j]:
# print('>', end=' ')
# else:
# print('=', end=' ')
# print()
# count = 0
# data = [1,2,3,4,5,1,2,3,4,1,2,3]
# # for i in range(len(data)):
# # if data[i] == 1:
# # count+=1
# #
# # print(count)
#
# print(data.count(1))
# data = 'Hello world'
# print(type(data))
# print(data)
#
# print(data.count('e'))
# data = list(data)
# print(type(data))
# print(data)
# print(data.count('e'))
# data.
# n = input()
# data = n
# print('a:', data.count('a'), sep='')
# print('b:', data.count('b'), sep='')
# print('c:', data.count('c'), sep='')
# print('d:', data.count('d'), sep='')
# print('e:', data.count('e'), sep='')
# print('f:', data.count('f'), sep='')
# print('g:', data.count('g'), sep='')
# print('h:', data.count('h'), sep='')
# print('i:', data.count('i'), sep='')
# print('j:', data.count('j'), sep='')
# print('k:', data.count('k'), sep='')
# print('l:', data.count('l'), sep='')
# print('m:', data.count('m'), sep='')
# print('n:', data.count('n'), sep='')
# print('o:', data.count('o'), sep='')
# print('p:', data.count('p'), sep='')
# print('q:', data.count('q'), sep='')
# print('r:', data.count('r'), sep='')
# print('s:', data.count('s'), sep='')
# print('t:', data.count('t'), sep='')
# print('u:', data.count('u'), sep='')
# print('v:', data.count('v'), sep='')
# print('w:', data.count('w'), sep='')
# print('x:', data.count('x'), sep='')
# print('y:', data.count('y'), sep='')
# print('z:', data.count('z'), sep='')
# x = 'a'
# y = 'z'
# print(x, y)
# x = ord(x)
# y = ord(y)
# print(x, y)
# n = input()
# data = n
# for i in range(97, 123):
# print(chr(i),':', data.count(chr(i)), sep='')
# import sys
# from PyQt5.QtWidgets import QApplication, QWidget
# import tkinter
#
# class MyApp(QWidget):
#
# def __init__(self):
# super().__init__()
# self.initUI()
#
# def initUI(self):
# self.setWindowTitle('My First Application')
# self.move(300, 300)
# self.resize(400, 200)
# self.show()
#
# if __name__ == '__main__':
# app = QApplication(sys.argv)
# ex = MyApp()
# sys.exit(app.exec_())
# n = input()
# data = n
# n = str
# print(data.count('('), data.count(')'))
# 함수: function < factory
# def func( ):
# print('Here is Function inside')
#
# # x, y = map(int, input().split())
# func()0
#
# def plus(i):
# sum = 0
# return (n)
# n = input()
# n = list(n)
# return (n)
#
# for i in range(len(n)):
# sum += i
# if i > 10:
# continue
# print()
def plus(k):
v = str(k)
sum = 0
for i in range(10):
sum += ( i * v.count(chr(i+48)) )
return sum
n = int(input())
for i in range(10000000):
n = plus(n)
if n < 10:
break
print(n)
# def v(a, b):
#
# return a+b
#
# print(v(10, 20))
# def calcu(k):
# s = 0
# #
# #
# #
# return s
#
# n = int(input())
# x = calcu(n)
#
# print(x)
top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
221011
221011
댓글 0개
좋아요
댓글(0)
더 이상 게시물에 대한 댓글 기능이 지원되지 않습니다. 자세한 사항은 사이트 소유자에게 문의하세요.
bottom of page


