Wrong answer when my code is correct

My program is correct as I have checked it in compile and test but upon submitting it shows wrong answer

import java.util.*; public class Main { static int count = 0; public static void main(String args[]) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-- > 0){ int n = in.nextInt(); count = 0; if(n!=0){ assignment(n,false); } System.out.println("#"+n+ " : "+ count); } } static void assignment(int n, boolean isLastB){ if(n==0){ count++; return; } if(!isLastB){ assignment(n-1,true); } assignment(n-1,false); } }

@mansi2000
simple debug your code for custom input
and after every test case set count =0;
simple do this
public static int answer(int n) {
if (n == 2 || n == 1) {
return n+1;
}
return answer(n - 1) + answer(n - 2);
}

it is still showing wrong answer. I even tried your code And my code is right.

This is ridiculous. please provide a detailed output format in this question my code was right but output format wasnt

@mansi2000
the output format was shown in the sample output.Its pretty easy to see that.
Also please share your code by saving it on ide.codingblocks.com in future so that its legible