0
Good evening! I’m starting in Java, and I’m trying to complete the Circumference Area Code of the URI. You’re giving a lot of trouble:
Exception in thread "main" java.util.Nosuchelementexception at java.util.Scanner.throwFor(Scanner.java:862) at java.util.Scanner.next(Scanner.java:1485) at java.util.Scanner.nextDouble(Scanner.java:2413) at Main.main(Main.java:9)
This is the code.
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double raio = scan.nextDouble();
double n = 3.14159;
double area = Math.pow(raio,2) * n;
System.out.println("A=" +area);
}
}
What am I doing wrong? Thanks in advance.
I copied and pasted your code here and ran normal. It may be a problem on the challenging site... Also, it may be that you haven’t filled in the entry...
– Leonardo Alves Machado