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