Math.pow は、Javaでべき乗の計算を行うためのメソッドです。 Math クラスの一部であり、任意の数値の累乗を計算することができます。 Math.pow の戻り値は必ず double 型になるため、整数として使いたい場合は (int) でキャストする必要があります。 int result = (int ...
// Math.pow() is used to return a value of the first argument raised to // the power of second argument.
import java.util.Scanner; public class Main { public static void main(String arg[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int last = n%10; int ...