在别人做的题目中看到的importjava.io.BufferedInputStream;importjava.io.BufferedOutputStream;importjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.FileRea...
在别人做的题目中看到的
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
static Scanner cin;
static PrintWriter cout;
static {
try {
cin = new Scanner(new BufferedReader(new FileReader("A.in")));
cout = new PrintWriter(new BufferedWriter(new FileWriter("A.out")));
} catch (IOException e) {
cin = new Scanner(new BufferedInputStream(System.in));
cout = new PrintWriter(new BufferedOutputStream(System.out));
}
}
public static void main(String[] args) {
for (int T=cin.nextInt(); cin.hasNext()&&T-->0; solve(cin.next())); //就是这里
closeIO();
}
final static char[]PRONOUNCE="OOTTFFSSEN".toCharArray();
private static void solve(String number) {
for(int i=number.length()-1;i>=0;i--)
cout.print(PRONOUNCE[number.charAt(i)-'0']);
cout.println();
}
private static void closeIO() {
if (cin != null) cin.close();
if (cout != null) cout.close();
}
}
展开