import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class NumberFormat {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
ArrayList<String> list = new ArrayList<String>();
int t = Integer.parseInt(in.nextLine());
String map[] = new String[] { "ling", "yi", "er", "san", "si", "wu", "liu", "qi", "ba", "jiu" };
String dec[] = new String[] { "wang","qian", "bai", "shi", "" };
for (int i = 0; i < t; i++) {
//使用nextInt去掉0
Integer a = in.nextInt();
list.add(a.toString());
}
for (int j = 0; j < list.size(); j++) {
String a = list.get(j);
StringBuilder result=new StringBuilder();
int flag = 0;
for (int k = 5; k >= 1; k--)
if (list.get(j).length() >= k) {
if (a.charAt(0) != '0') {
result.append(map[a.charAt(0) - '0'] + " " + dec[5 - k] + " ");
flag = 0;
} else if (flag == 0) {
result.append("ling ");
flag = 1;
}
a = a.substring(1, a.length());
}
//去掉最后的0
if(result.length()>5&&result.toString().substring(result.length()-5, result.length()-1).equals("ling"))
System.out.println(result.toString().substring(0,result.length()-5));
else
System.out.println(result.toString().substring(0, result.length()));
}
}
}
阅读(886) | 评论(0) | 转发(0) |