#include <stdio.h>
//正の奇数nを引数とし,以下の正の奇数の和を求める関数
int rec(int n){
if(n%2==0){
n--;
}
if (n == 1){
return 1;
}
else{
return n+rec(n-2);
}
}
int main(void) {
int n = 11;
printf("%d以下の正の奇数の和は%d\n", n
, rec
(n
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8v5q2j44Gu5aWH5pWwbuOCkuW8leaVsOOBqOOBl++8jOS7peS4i+OBruato+OBruWlh+aVsOOBruWSjOOCkuaxguOCgeOCi+mWouaVsAppbnQgcmVjKGludCBuKXsKCWlmKG4lMj09MCl7CgkJbi0tOwoJfQogICAgaWYgKG4gPT0gMSl7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICBlbHNlewogICAgICAgIHJldHVybiBuK3JlYyhuLTIpOwogICAgfQp9CmludCBtYWluKHZvaWQpIHsKICAgIGludCBuID0gMTE7CiAgICBwcmludGYoIiVk5Lul5LiL44Gu5q2j44Gu5aWH5pWw44Gu5ZKM44GvJWRcbiIsIG4sIHJlYyhuKSk7CglyZXR1cm4gMDsKfQ==