C++ 核桃礼盒包装问题:计算所需礼盒数量和可送礼盒数量
#include
int main() { int n, m; cin >> n >> m;
int totalBoxes = n / m;
int remainingWalnuts = n % m;
if (remainingWalnuts != 0) {
totalBoxes++;
}
cout << totalBoxes << endl;
cout << totalBoxes - 1 << endl;
return 0;
}
原文地址: https://www.cveoy.top/t/topic/ixNH 著作权归作者所有。请勿转载和采集!