1。直接把浮点数转成整数再加1
2。用Math.floor(number) + 1
2。用Math.floor(number) + 1
解决方案 »
- 有关汉字的asc值
- java swing awt 怎么有错??急急,在线等待中
- 求信息发布接口的代码作一下参考!急!急!
- java截取字符串
- JSP怎么学啊?
- java实现动态加载时遇到的问题(有代码和编译错误提示)
- 请问如何将java程序编译成可执行程序???
- java如何获取sqlcode
- 如何定位frame在屏幕中的显示位置?
- "FormatFunction.java": Error #: 354 : incompatible types; found: java.lang.String, required: int at line 117, column 29 这是什么
- 初用JAVA,编译成问题(五分钟结帐)
- 我是个新手,请帮帮忙。
{
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); }}
给分!
Math.floor(0.25)=0
java.lang.Math.ceil(i);