aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/go_upstairs.sy
blob: 1ddfe34589d9af2b91d66c739f85f87c50b249c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int n;
int result[1024] = {};

int main() {
	n = getint();
	result[1] = 1;
	result[2] = 1;
	int i = 3;
	while (i <= n) {
		result[i] = result[i - 1] + result[i - 2];
		i = i + 1;
	}
	putint(result[n]);
	putch(10);
	return 0;
}