首页 > 代码库 > NYOJ题目198数数

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

NYOJ题目198数数