2010年10月1日金曜日

PKU Judge Online 3077 Rounders

■3077 Rounders

□Problem
省略.

□Solution
省略.

□Code
  1. package p3077;  
  2.   
  3. import java.util.*;  
  4. import java.lang.*;  
  5. import java.math.*;  
  6. import java.io.*;  
  7.   
  8. import static java.lang.Math.*;  
  9. import static java.util.Arrays.*;  
  10.   
  11. // AC  
  12. public class Main{  
  13.   
  14.  Scanner sc=new Scanner(System.in);  
  15.   
  16.  final int INF=Integer.MAX_VALUE;  
  17.  final double EPS=1e-9;  
  18.   
  19.  void run(){  
  20.   for(int n=sc.nextInt(); n>0; n--){  
  21.    int m=sc.nextInt();  
  22.    int ans=1;  
  23.    for(; m/10!=0;){  
  24.     if(m%10>=5)  
  25.      m+=10;  
  26.     m/=10;  
  27.     ans*=10;  
  28.    }  
  29.    ans*=m;  
  30.    println(ans+"");  
  31.   }  
  32.  }  
  33.   
  34.  void print(String s){  
  35.   System.out.print(s);  
  36.  }  
  37.   
  38.  void println(String s){  
  39.   System.out.println(s);  
  40.  }  
  41.   
  42.  public static void main(String[] args){  
  43.   // System.setOut(new PrintStream(new BufferedOutputStream(System.out)));  
  44.   new Main().run();  
  45.  }  
  46. }  

0 件のコメント: