You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python/GESP/New_WuHouFenTao_3.cpp

21 lines
449 B

#include <bits/stdc++.h>
using namespace std;
int main() {
// 倒推
int x; // 目前计算出的原来桃子的总数量
int i = 0;
int j = 1; // 最后一个猴子分得的桃子数量为4的j倍
while (i < 5) {
x = 4 * j;
for (i = 0; i < 5; i++) {
if (x % 4 != 0) { break; }
x = (x / 4) * 5 + 1;
}
j++;
}
printf("%d\n", x);
return 0;
}