import java.util.Scanner;


public class XPowerN {

public static void main(String args[]){

Scanner stdIn = new Scanner(System.in);

System.out.println("Input x please");

double x = stdIn.nextDouble();

stdIn.close();

System.out.println("Input n please");

int n = stdIn.nextInt();

stdIn.close();

do{

if(n%2==0){

x=Math.pow(x,2);

n=n/2;

}

else{

x=x*x;

--n;

}

}while(n!=1 && n!=0);


System.out.println("The Answer is" + x);

}

}


이렇게 했는데 에러뜸


Exception in thread "main" java.util.InputMismatchException

at java.util.Scanner.throwFor(Unknown Source)

at java.util.Scanner.next(Unknown Source)

at java.util.Scanner.nextDouble(Unknown Source)

at XPowerN.main(XPowerN.java:7)


아니 시발 왜 왜 에러가 뜨는건데

도와줘라 게이들아 씨발 진짜 모르겠다