#include <stdio.h>
int func(int n) {
return n == 0 ? 1 : func(n - 1) - n;
}
int main() {
int a;
printf("Digite um valor inteiro: "); int n = a;
int temp = 1;
while (1) {
temp -= n;
n--;
if (n == 0) break;
}
}
//https://pt.stackoverflow.com/q/347752/101
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgZnVuYyhpbnQgbikgewogICAgcmV0dXJuIG4gPT0gMCA/IDEgOiBmdW5jKG4gLSAxKSAtIG47Cn0KCmludCBtYWluKCkgewogICAgaW50IGE7CiAgICBwcmludGYoIkRpZ2l0ZSB1bSB2YWxvciBpbnRlaXJvOiAiKTsKICAgIHNjYW5mKCIlZCIsICZhKTsKICAgIHByaW50ZigiJWRcbiIsIGZ1bmMoYSkpOwogICAgaW50IG4gPSBhOwogICAgaW50IHRlbXAgPSAxOwogICAgd2hpbGUgKDEpIHsKICAgIAl0ZW1wIC09IG47CiAgICAJbi0tOwogICAgCWlmIChuID09IDApIGJyZWFrOwogICAgfQogICAgcHJpbnRmKCIlZFxuIiwgdGVtcCk7Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzM0Nzc1Mi8xMDE=