#include <stdio.h>
int sigma(int n){
if (n == 1){
return 1;
}
else{
return n + sigma(n-1);
}
}
int main(void) {
int n = 4;
printf("1から%dまでの和は%d\n", n
, sigma
(n
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBzaWdtYShpbnQgbil7CiAgICBpZiAobiA9PSAxKXsKICAgICAgICByZXR1cm4gMTsKICAgIH0KICAgIGVsc2V7CiAgICAgICAgcmV0dXJuIG4gKyBzaWdtYShuLTEpOwogICAgfQp9CgppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgbiA9IDQ7CiAgICBwcmludGYoIjHjgYvjgoklZOOBvuOBp+OBruWSjOOBryVkXG4iLCBuLCBzaWdtYShuKSk7CglyZXR1cm4gMDsKfQo=