问题描述
class WhileDemo2{public static void main(String[] args){double dayMoney=2.5;double daySum=0;int dayCount=1;double result=100;while(daySum<=result){daySum+=dayMoney;if(dayCount%5==0){daySum-=6;}dayCount++;System.out.println(daySum);System.out.println(dayCount);}}}为什么结果是75天和老师的不一样
问题解答
回答1:注意while条件