#include <stdio.h>
#define MAX 3
int GLOBAL_COUNT = MAX;
void contador();
int main() {
for(int i = 0; i <= 7; i++) {
contador();
}
return 0;
}
void contador() {
if (GLOBAL_COUNT <= 0) {
GLOBAL_COUNT = MAX;
}
printf("chamada: %d/%d\n", GLOBAL_COUNT
, MAX
); GLOBAL_COUNT--;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgojZGVmaW5lIE1BWCAzCgppbnQgR0xPQkFMX0NPVU5UID0gTUFYOwoKdm9pZCBjb250YWRvcigpOwoKaW50IG1haW4oKSB7CiAgICBmb3IoaW50IGkgPSAwOyBpIDw9IDc7IGkrKykgewogICAgCWNvbnRhZG9yKCk7CiAgICB9CiAgICByZXR1cm4gMDsKfQoKdm9pZCBjb250YWRvcigpIHsKICAgIGlmIChHTE9CQUxfQ09VTlQgPD0gMCkgewogICAgCUdMT0JBTF9DT1VOVCA9IE1BWDsKICAgIH0KICAgIHByaW50ZigiY2hhbWFkYTogJWQvJWRcbiIsIEdMT0JBTF9DT1VOVCwgTUFYKTsKICAgIEdMT0JBTF9DT1VOVC0tOwp9Cg==