#include <stdio.h>
//課題B-1: 1からnまでの和を求めるコードを完成させてください
int sum(int n){
	int c = 0;
	int d = 0;
	while(n -- > 1)
	c++;
	d = c + d;
	return c;	
}

int main(void) {
	int a,b;
    a = 10;
    b = sum(a);
    printf("1から%dまでの和は%d", a,b );
	return 0;
}
