import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
int[]arr=new int[77];
arr[1]=1;
arr[2]=arr[3]=2;
for(int i=4;i<77;i++){
arr[i]=arr[i-2]+arr[i-3];
}
String m="";
while ((m=br.readLine())!=null) {
int x = Integer.parseInt(m);
sb.append(arr[x]).append("\n");
}
System.out.print(sb);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
int[]arr=new int[77];
arr[1]=1;
arr[2]=arr[3]=2;
for(int i=4;i<77;i++){
arr[i]=arr[i-2]+arr[i-3];
}
String m="";
while ((m=br.readLine())!=null) {
int x = Integer.parseInt(m);
sb.append(arr[x]).append("\n");
}
System.out.print(sb);
}
}
No comments:
Post a Comment