标签:
int num = 0;
for (int i = 1; i < 1000; i++) {
num+=3;
if(num>=7){
System.out.println("这只青蛙"+i+"天能爬出这口井!");
break;
}
num-=2;
}
有口井7米深,一只青蛙白天爬3米,晚上坠下2米,问这青蛙几天才能爬出这口井?
标签:
原文地址:http://www.cnblogs.com/bd195746/p/5813874.html