[정올] Language Coder_반복제어문2_자가진단4_code544 (C/Python)

두비니

·

2020. 3. 21. 04:11

<C>

#include <stdio.h>

int main() {

	int n, sum=0;
	
	scanf("%d", &n);

	for (int i = n; i <= 100; i++) {
		sum += i;
	}

	printf("%d", sum);

	return 0;
} 

 

<Python>

 

n = int(input())

sum = 0
for i in range(n, 101):
    sum = sum + i

print(sum)