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.

22 lines
612 B

#include <bits/stdc++.h>
// https://blog.csdn.net/weixin_43772810/article/details/121048802
// https://blog.csdn.net/weixin_43772810/article/details/121297946
using namespace std;
int main() {
int i = 0, j = 0;
int tmp = 0;
for (i = 1; i <= 10000; i++) {
tmp = i;
for (j = 0; j < 5; j++) {
if ((tmp - 1) % 5 != 0 || tmp <= 1)
break;
tmp = (tmp - 1) / 5 * 4;
}
if (j == 5) {
printf("there was %d peaches.\n", i);
exit(0);
}
}
printf("thats too more!");
return 0;
}