package 不用乘法运算符实现2X16; import java.util.Scanner; public class 不用乘法运算符实现2X16 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("请输入一个整数"); long number = scan.nextLong(); System.out.println("你输入的数字是"+number); System.out.println("该数字乘以2的运算结果为"+(number << 1)); System.out.println("该数字乘以4的运算结果为"+(number << 2)); System.out.println("该数字乘以8的运算结果为"+(number << 3)); System.out.println("该数字乘以16的运算结果为"+(number << 4)); } }
原文地址:https://www.cnblogs.com/JAYPARK/p/10099019.html
时间: 2024-10-16 04:06:50