|
|
вернуться в форумWhat is wrong??? import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a,n=0; a = in.nextInt(); a = (int) (Math.pow(1,a)+Math.pow(2,a)+Math.pow(3,a)+Math.pow(4,a)); int b[] = new int[11000]; while(a>0){ if(a%10==0)n++; else break; a = a/10; } System.out.print(n); } } Re: No subject You have overflow at this line --->a = (int) Math.pow(1,a)+Math.pow(2,a)+Math.pow(3,a)+Math.pow(4,a)); |
|
|