import java.io.*; /** * 读进来数字,再转换成 String、StringBuffer(可以反转)、char[](每位数字) */ 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; String s = Integer.toString(n); StringBuffer str = new StringBuffer(s); char[] c = s.toCharArray(); cout.println(s.length()); for (int i = 0; i < c.length; i++) { if (i != c.length - 1) { cout.print(c[i] + " "); } else { cout.println(c[i]); } } cout.print(str.reverse()); cout.flush(); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1334 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:1292 |
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:616 |
【求[X,Y]内被除3余1并且被除5余3的整数的和】 (C语言代码)浏览:703 |
1017题解浏览:663 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:904 |
A+B for Input-Output Practice (C语言代码)浏览:505 |
剪刀石头布 (C++代码)浏览:1811 |
简单的a+b (C语言代码)浏览:491 |
上车人数 (C语言代码)浏览:753 |