如果有帮助的话,请点击右上角【采纳】按钮,支持一下!!
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
System.out.println(1.0*x/(y*y));
}
平方不是用^符号。你可以写成 x/(y*y)或者x/pow(y,2)
在Java中^符号表示亦或运算,位运算的一种,不是以前用的计算器中的那种次幂符号