'commit'
This commit is contained in:
19
GESP/资料/New_WuHouFenTao_2.cpp
Normal file
19
GESP/资料/New_WuHouFenTao_2.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int i, j;
|
||||
for (i = 6;; i += 5) {
|
||||
int x = i;
|
||||
for (j = 0; j < 5; j++) {
|
||||
if ((x - 1) % 5 != 0 || x <= 1) // 扔掉一个是否能分成5份
|
||||
break; // 不符合要求
|
||||
x = (x - 1) / 5 * 4; // 分完第j+1次后剩下的桃子
|
||||
}
|
||||
if (j == 5) { // 符合条件
|
||||
printf("%d", i);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user