백준 9095 1,2,3 더하기
package Baekjoon;
import java.util.Scanner;
public class B9095 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int dp[] = new int [11];
int c = sc.nextInt();
dp[1] = 1;
dp[2] = 2;
dp[3] = 4;
for (int j = 4; j <= 10; j++) {
dp[j] = dp[j - 3] + dp[j - 2] + dp[j - 1];
}
for (int i = 0; i < c; i++) {
int n = sc.nextInt();
System.out.println(dp[n]);
}
}
}