U E D R , A S I H C RSS

World Cup Noise/정진경

Source Code

#include <stdio.h>

int main()
{
	int Table[50][2];
	int N, n;
	int k;
	int i, j;

	scanf("%d", &N);

	Table[1][0]=1;
	Table[1][1]=1;

	for(i=2; i<50; i++){
		Table[i][0]=Table[i-1][1]+Table[i-1][0];
		Table[i][1]=Table[i-1][0];
	}

	for(n=1; n<=N; n++){
		scanf("%d", &k);

		printf("Scenario #%d:\n%d\n\n", n, Table[k][0]+Table[k][1]);
	}

	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:26
Processing time 0.0140 sec