import java.io.*; /** * Java 提供的 String 与 int 相互转换的方法解决这题十分方便 */ 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; StringBuffer s = new StringBuffer("2"); int sum = Integer.parseInt(s.toString()); for (int i = 2; i <= n; i++) { s.append("2"); sum += Integer.parseInt(s.toString()); } cout.print(sum); cout.flush(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:504 |
Wu-求圆的面积 (C++代码)浏览:1994 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:580 |
A+B for Input-Output Practice (V) (C语言代码)浏览:497 |
Tom数 (C语言代码)浏览:517 |
杨辉三角 (C语言代码)浏览:505 |
C二级辅导-公约公倍 (C语言代码)浏览:537 |
数列有序 (C语言代码)浏览:974 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:630 |
C语言程序设计教程(第三版)课后习题11.8 (C语言代码)浏览:1060 |