#include <stdio.h>
int seq() {
static int current_term = 1;
int result = current_term;
current_term++;
return result;
}
int main() {
printf("2nd term: %d\n", seq
()); printf("3rd term: %d\n", seq
()); printf("4th term: %d\n", seq
()); printf("5th term: %d\n", seq
()); printf("6th term: %d\n", seq
()); printf("7th term: %d\n", seq
()); printf("8th term: %d\n", seq
()); printf("9th term: %d\n", seq
()); printf("10th term: %d\n", seq
());
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgc2VxKCkgewogICAgc3RhdGljIGludCBjdXJyZW50X3Rlcm0gPSAxOyAKICAgIGludCByZXN1bHQgPSBjdXJyZW50X3Rlcm07ICAKICAgIGN1cnJlbnRfdGVybSsrOwoKICAgIHJldHVybiByZXN1bHQ7Cn0KCmludCBtYWluKCkgewogICAgcHJpbnRmKCIybmQgdGVybTogJWRcbiIsIHNlcSgpKTsgCiAgICBwcmludGYoIjNyZCB0ZXJtOiAlZFxuIiwgc2VxKCkpOyAKICAgIHByaW50ZigiNHRoIHRlcm06ICVkXG4iLCBzZXEoKSk7IAogICAgcHJpbnRmKCI1dGggdGVybTogJWRcbiIsIHNlcSgpKTsgCiAgICBwcmludGYoIjZ0aCB0ZXJtOiAlZFxuIiwgc2VxKCkpOwogICAgcHJpbnRmKCI3dGggdGVybTogJWRcbiIsIHNlcSgpKTsgCiAgICBwcmludGYoIjh0aCB0ZXJtOiAlZFxuIiwgc2VxKCkpOwogICAgcHJpbnRmKCI5dGggdGVybTogJWRcbiIsIHNlcSgpKTsgCiAgICBwcmludGYoIjEwdGggdGVybTogJWRcbiIsIHNlcSgpKTsgCgogICAgcmV0dXJuIDA7Cn0K