NYOJ题目198数数

------------------------------------------

 

水。

 

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

相关文章:

  • 2022-02-27
  • 2021-06-22
  • 2022-12-23
  • 2021-06-30
  • 2021-07-31
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-10
  • 2021-05-28
  • 2021-11-30
  • 2021-06-25
  • 2021-12-23
  • 2021-08-15
  • 2022-01-21
相关资源
相似解决方案