public class Main_202 {
//百万富翁和一个陌生人
public static void main(String[] args) {
System.out.print(10 * 30);
int a = 0;
for (long i = 0;
i < 30;
i++) {
a = (int) (a + Math.pow(2,i));
}
System.out.print(" " + a);
}
}
【百万富翁和一个陌生人】
public class Main_202 {
//百万富翁和一个陌生人
public static void main(String[] args) {
System.out.print(10 * 30);
int a = 0;
for (long i = 0;
i < 30;
i++) {
a = (int) (a + Math.pow(2,i));
}
System.out.print(" " + a);
}
}