Do not use Java in the large number of templates do see Hdu1002,java write is very easy is super memory!!!
Problem DescriptionThe I-number of x is defined to being an integer y, which satisfied the the conditions below:
1.y>x;
2.The sum of each digit of Y (under base) is the multiple of 10;
3.Among all integers this satisfy the conditions above, y shouble be the minimum.
Given x, you ' re required to calculate the I-number of X.
Inputan integer T (t≤100) would exist in the first line of input, indicating the number of test cases.
The following T lines describe all the queries and each with a positive integer x. The length of x would not exceed 105.
Outputoutput the I-number of x for each query.
Sample Input
1202
Sample Output
208
Implementation code
Import Java.util.*;import java.math.*;class main{public static void Main (string[] args) { final BigInteger p= Biginteger.one; Scanner sc=new Scanner (system.in); int T=sc.nextint (); while (t-->0) { int sum; BigInteger X=sc.nextbiginteger (); while (true) { x=x.add (P); String str=x.tostring (); sum=0; for (int i=0;i<str.length (); i++) { Sum+=str.charat (i)-' 0 '; } if (sum%10==0) { System.out.println (x); Break;}}}}
Hangzhou Electric 4608 (I-number) Java write very easy is super memory!!!