import java.io.*; /** * 从第 N 天剩下一个桃子时退回第一天 */ public class Main { public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws Exception { cin.nextToken(); int n = (int) cin.nval; int sum = 1; for (int i = n - 1; i > 0; i--) { sum = (sum + 1) * 2; } cout.print(sum); cout.flush(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:538 |
简单的a+b (C语言代码)浏览:676 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:806 |
C二级辅导-统计字符 (C语言代码)浏览:529 |
【绝对值排序】 (C语言代码)浏览:832 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:998 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:669 |
简单的a+b (C语言代码)浏览:601 |
【蟠桃记】 (C语言代码)浏览:1084 |
循环入门练习6 (C语言代码)浏览:1058 |