Poj Solution 3077

http://poj.org/problem?id=3077

import java.math.BigInteger;
import java.util.*;

public class Main
{

    public static void main(String args[])
    {
       int n, s, i;
       Scanner cin = new Scanner( System.in );
       n = cin.nextInt();
       while( n-- != 0 ) {
           s = cin.nextInt();
           for( i=10; i<=100000000; i*=10 )
               if( s >= i ) {
                   s = (s+i/2)/i*i;
               }
           System.out.println( s );
       }
       return;
    }
}
											
This entry was posted in poj. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *