Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Java CE 可是Ediplus通过了。。报错里面也是空的import java.util.*; import java.math.*; import java.lang.*; import java.io.*; public class Main { static int Solve(int x){ int i; if(x==0) return 1; int res = 3*Solve(x-2); for(i=x-4;i>=0;i-=2) res += 2*Solve(i); return res; } public static void main(String[] args) { Scanner cin = new Scanner(System.in); int N = cin.nextInt(); while(N>=0){ if(N%2==1) System.out.println("0"); else System.out.println(Solve(N)); N = cin.nextInt(); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator