1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <stdio.h> int compute_sum(int n); int main(void) { int sum; sum = compute_sum(100); printf("1ºÎÅÍ 100±îÁöÀÇ ÇÕ = %d \n", sum); return 0; } int compute_sum(int n) { int i; int result = 0; for (i = 1; i <= n; i++) result += i; return result; } | cs |