1。直接把浮点数转成整数再加1
2。用Math.floor(number) + 1

解决方案 »

  1.   

    public class TestInt
    {
        public TestInt()
        {
        }
        public static void main(String[] args) {        int a=5;int b=2;
            int c=a/b+1;
            if (a % b==0) c=a/b;
            System.out.println(c);    }}
      

  2.   

    有道理,我怎么没想到!谢谢feiyuegaoshan(飞跃)
    给分!
      

  3.   

    Math.ceil(0.25)=1
    Math.floor(0.25)=0
      

  4.   

    double i=0.25;
    java.lang.Math.ceil(i);
      

  5.   

    一楼的说得是不正确地,Integer.parseInt(String number)传入的参数是String的