fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.math.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14. Scanner s =new Scanner(System.in);
  15. factor z=new factor();
  16.  
  17. BigInteger b= new BigInteger("1");
  18. BigInteger i = new BigInteger("0");
  19. BigInteger [] a= new BigInteger [100];
  20. BigInteger [] p=new BigInteger[100];
  21. BigInteger n=s.nextBigInteger();
  22.  
  23. while(i.compareTo(n))
  24. {
  25. a[i]=s.nextBigInteger();
  26. i.add(b);
  27. }
  28.  
  29. while(i.compareTo(n))
  30. {
  31. p[i]=z.factorial(a[i]);
  32. i.add(b);
  33. }
  34. }
  35. }
  36.  
  37.  
  38. class factor{
  39. public static BigInteger factorial(BigInteger n) {
  40.  
  41. BigInteger fact = new BigInteger("1");
  42. BigInteger i = new BigInteger("0");
  43. BigInteger a = new BigInteger("1");
  44.  
  45. while(i.compareTo(n))
  46. {
  47. fact = fact.multiply(i) ;
  48. i.add(a);
  49. }
  50. return fact;
  51. }
  52. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
5 3
compilation info
Main.java:23: error: incompatible types
		while(i.compareTo(n))
		                 ^
  required: boolean
  found:    int
Main.java:25: error: incompatible types
			a[i]=s.nextBigInteger();
			  ^
  required: int
  found:    BigInteger
Main.java:29: error: incompatible types
		while(i.compareTo(n))
		                 ^
  required: boolean
  found:    int
Main.java:31: error: incompatible types
			p[i]=z.factorial(a[i]);
			  ^
  required: int
  found:    BigInteger
Main.java:31: error: incompatible types
			p[i]=z.factorial(a[i]);
			                   ^
  required: int
  found:    BigInteger
Main.java:45: error: incompatible types
        while(i.compareTo(n))
                         ^
  required: boolean
  found:    int
6 errors
stdout
Standard output is empty