bar1 = store1/1000;
System.out.print("Store 1: ");
for(int i = 1; i <= bar1; i++)
System.out.print("*");
如何显示“*”的数量向上或向下舍入到最接近的千位。现在它只是向下舍入。
最佳答案
使用
bar1 = (store1+500)/1000;
System.out.print("Store 1: ");
for(int i = 1; i <= bar1; i++)
System.out.print("*");
关于java - 如何显示星号的数量到最接近的千位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28622776/