power.java
来自「自己写的学校网站框架」· Java 代码 · 共 31 行
JAVA
31 行
package edu.xjusoft.common;
public class Power
{
public static int userPurview(int b) {
double a = 2;
double bb = b;
int purview = (int) Math.pow(a, bb);
return purview;
}
public static boolean checkPower(int userPurview, int optPurview) {
System.out.println("�û���ӵ��Ȩ�ޣ�" + userPurview + ",��ҪȨ�ޣ�" + optPurview);
int purviewValue = (int) Math.pow(2, optPurview);
int f1 = userPurview & purviewValue;
int f2 = purviewValue;
System.out.println("f1:" + f1 + " , f2:" + f2);
boolean flag = f1 == f2;
return flag;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?