public class Main {
public static void main(String[] args) {
long product = 1L;
product = (9 * 9 * 9 * 9 * 9 * 9 * 9 * 9 * 9 * 9 * 9 * 9 * 9);
System.out.println(product);
product = 9L;
for (int i = 0; i != 12; i++) {
product *= 9;
}
System.out.println(product);
}
}
Run Code Online (Sandbox Code Playgroud)
输出:-754810903
2541865828329 //这个是正确的
当我运行代码时,数组p没有排序.我弄清楚了
为什么会这样?
import java.util.Arrays;
public class Main {
public static void main (String[] args){
//creating array p
int[] p= new int[] {2,7,8,3,9,1,4,5,6,0 };
//sort p[5] to p[9]
Arrays.sort(p, 5, 9);
for(int l=0;l<p.length;l++)
{
System.out.print(p[l]);
}
}
}
Run Code Online (Sandbox Code Playgroud)
输出为:2783914560
java ×2