各位兄台帮帮忙,如何求41向上取整等于50呢? 谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 进到十位int in = 41 , out;out = in/10;out++;out *= 10;或者只进到最高位int in = 4321 , out ,count=0;out = in;while(out%10!=0){ out/=10; count++;}out++;for(;count>0;count--){ out*=10;} 谢谢各位的解答,不过我想明白了,我做一个手机测量心率,本来要设置一个最大值呢,我老大说让我按照上面举的例子做呢,但是现在我这么想的,只要出现的值大于规定的那个值,便给它+10,这样的话,折线图也就不会显示不全的了。java code: yMax=70; if(y>yMax){ yMax+=10; renderer.setYAxisMax(yMax); }我就这么简单的判断了下。 int a = 41;int b = a % 10 == 0 ? a : (a / 10 + 1) * 10; android源代码编译之后,烧入板子中没有声音 ffmpeg播放问题 Adapter 问题 我真的不是很明白!!! Google Map 搜索与定位指定位置 MAC 下的SDK Eclipse3.6.1配置ADT的时候总失败?如何解决 Fragment需要和service通信,用广播怎么实现? 关于android中植入广告的问题 android无线热点状态监听 android surfaceview canvas 画线问题 对话框 可以旋转吗 关于继承BaseAdapter
out = in/10;
out++;
out *= 10;
或者只进到最高位int in = 4321 , out ,count=0;
out = in;
while(out%10!=0){
out/=10;
count++;
}
out++;
for(;count>0;count--){
out*=10;
}
java code:
yMax=70;
if(y>yMax){
yMax+=10;
renderer.setYAxisMax(yMax);
}
我就这么简单的判断了下。
int b = a % 10 == 0 ? a : (a / 10 + 1) * 10;