------------------------------------------
水。
AC代码:
1 import java.util.Scanner; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 7 Scanner sc=new Scanner(System.in); 8 int times=sc.nextInt(); 9 while(times-->0){ 10 int n=sc.nextInt(); 11 System.out.println(solve(n)); 12 } 13 14 } 15 16 public static char mapping[]="OOTTFFSSEN".toCharArray(); 17 18 public static String solve(int n){ 19 StringBuffer sb=new StringBuffer(10); 20 while(n>0){ 21 sb.append(mapping[n%10]); 22 n/=10; 23 } 24 return sb.toString(); 25 } 26 27 }
题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=198
时间: 2024-10-03 15:01:29