1002 写出这个数


import java.util.Scanner;
public class Main {

	 public static void main(String[] args) {
		String[] PinYin = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
		Scanner in=new Scanner(System.in);
		String numStrings = in.next();
		int sum = 0;
		for (int i = 0; i < numStrings.length(); i++) {
			sum = sum + numStrings.charAt(i)- '0';
		 }
		String sumString = sum + "";
		
		for (int i = 0; i < sumString.length(); i++) {
			if (i == 0 ) {
				System.out.print(PinYin[sumString.charAt(i)-'0']);
				continue;
			}
			System.out.print(" "+PinYin[sumString.charAt(i) - '0']);
		}
		in.close();
	 }
}

 

上一篇:1002 A+B for Polynomials (25 分)


下一篇:题解 guP3956 棋盘