#include <stdio.h>
//課題B-1: 1からnまでの和を求めるコードを完成させてください
int sum(int n){
int sum=0;
for(int i=0;i<=n;i++){
sum=sum+i;
}
return sum;
}
int main(void) {
int a,b;
a = 10;
b = sum(a);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8v6Kqy6aGMQi0xOiAx44GL44KJbuOBvuOBp+OBruWSjOOCkuaxguOCgeOCi+OCs+ODvOODieOCkuWujOaIkOOBleOBm+OBpuOBj+OBoOOBleOBhAppbnQgc3VtKGludCBuKXsKCWludCBzdW09MDsKCWZvcihpbnQgaT0wO2k8PW47aSsrKXsKCQlzdW09c3VtK2k7Cgl9CglyZXR1cm4gc3VtOwp9CgppbnQgbWFpbih2b2lkKSB7CglpbnQgYSxiOwogICAgYSA9IDEwOwogICAgYiA9IHN1bShhKTsKICAgIHByaW50ZigiMeOBi+OCiSVk44G+44Gn44Gu5ZKM44GvJWQiLCBhLGIgKTsKCXJldHVybiAwOwp9Cg==