ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1295. Crazy Notions

What is wrong???
Posted by Yusufjon 19 May 2018 14:23
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);
    }
}
No subject
Posted by Yusufjon 19 May 2018 14:34
Help please??
Re: No subject
Posted by 👨‍💻tproger👨‍💻[GTGU] 19 May 2018 20:00
You have overflow at this line
--->a = (int) Math.pow(1,a)+Math.pow(2,a)+Math.pow(3,a)+Math.pow(4,a));