Java程序查找给定数字的多维数据集
值的多维数据集只是值与自身的三倍乘积。
例如,2的立方体为(2*2*2)=8。
算法
取整数变量A。
乘以三倍。
将结果显示为多维数据集。
示例
import java.util.Scanner;
public class FindingCube {
public static void main(String args[]){
int n = 5;
System.out.println("Enter a number ::");
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
System.out.println("Cube of the given number is "+(num*num*num));
}
}输出结果
Enter a number :: 5 Cube of the given number is 125
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短