Search posts, tags, users, and pages
Donghan Kim
문제 https://www.acmicpc.net/problem/8393 1부터 n까지의 합을 구하는 문제 풀이 간단하게 for loop 또는 while문을 활용해도 되지만 루프문을 활용하지 않고 간단한 수학 공식을 활용하여 문제를 풀 수 있다. n = int(input()) print((1+n) * n//2)
No responses yet.