公园门票计算:成人和儿童人数组合
#include <iostream>
using namespace std;
int main() {
for (int adult = 0; adult <= 40; adult++) {
for (int child = 40; child >= 0; child--) {
if (adult * 8 + child * 3 == 40) {
cout << adult << ' ' << child << endl;
}
}
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/jmpR 著作权归作者所有。请勿转载和采集!