题解 | #大吉大利,今晚吃鸡#
大吉大利,今晚吃鸡
https://www.nowcoder.com/practice/c9d9f9c60b4448eabc0569f80a3461bb
import java.util.Scanner;
// 手工然后找到规律搞的
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
double n = sc.nextDouble();
long m = (long)Math.pow(3.0, n) - 1;
System.out.println(m);
}
}
}
查看8道真题和解析