#13938: c / c++ answer


alexrobotvm0@gmail.com (黃子軒)


比較簡單的寫法

 

#include <stdio.h>

using namespace std;

int main() {
int num = 0;

while (scanf("%d", &num) != EOF) {
long long temp = 0;

for (temp = 1; temp < (num / 2) - temp; temp++);
printf("%lld\n", temp * ((num / 2) - temp));
}

return 0;
}