日期:2014-05-18  浏览次数:21285 次

以十为精度向上取整
例如  1,2,3,4···的话就取10 
      11,12,13,14···19就取20 
以此类推。

求算法

算法 取整

------解决方案--------------------
public class Test
{
public static void main(String[] args)
{
System.out.println(test(20));
}
static int test(int n)
{
if(0 == n % 10)
return n;

return (n / 10 + 1) * 10;
}
}