肥肠简单-吃桃
2026-05-12 21:16:17
发布于:浙江
7阅读
0回复
0点赞
也是非常简单,不懂的看注释。
#include <iostream> //头文件
using namespace std;
int main(){
int n,m;
cin >> n >> m;
int res = 0; //用于记录猴子有几天能吃饱
for(int i=m; i<=n; i++){
if(n-m < 0){
break;
}
n-=m;
res++; //计数
m++;
}
cout << res;
return 0;
}
这里空空如也








有帮助,赞一个