题解 | #大吉大利,今晚吃鸡#
大吉大利,今晚吃鸡
https://www.nowcoder.com/practice/c9d9f9c60b4448eabc0569f80a3461bb
#include <stdio.h> int num(int x)//类似汉诺塔的题目,找到规律 { if(x == 1) return 2; else return num(x - 1) * 3 + 2; } int main() { int n; while(scanf("%d\n",&n)==1) { printf("%d\n",num(n)); } return 0; }#菜狗的解题#