n=input()nums = []for i in range(n): n = int(input()) nums.append(n) def custom_sum(j): total = 0 for x in range(1, j+1): for l in range(1, j): if l % x != 0: total += l return totalfor i in range(n): result = custom_sum(nums[i]) print(total)
Standard input is empty
n=input() nums = [] for i in range(n): n = int(input()) nums.append(n) def custom_sum(j): total = 0 for x in range(1, j+1): for l in range(1, j): if l % x != 0: total += l return total for i in range(n): result = custom_sum(nums[i]) print(total)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!