I know you read about this problem too many times but i loose my mind trying to solve this. I surounded my code with try/catch block, added throws to main function but still sending me NZEC. I also changed my code, everywhere where i had Scanner now is standing BufferedReader but it is still unworth. I have to say that it works on my compailer but when i submit here I got a problem.
Here is my code for solving factoriels less or equail than 100:
public static void main(String[] args) throws Exception{
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
ArrayList biga = new ArrayList<>();
while (t != 0) {
int f = Integer.parseInt(br.readLine());
BigInteger bi = BigInteger.valueOf(1);
while (f != 0) {
bi = bi.multiply(BigInteger.valueOf(f));
f--;
}
biga.add(bi);
t--;
}
br.close();
for(BigInteger b:biga){
System.out.println(b);
}
}catch(Exception e){
return;
}
}