We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f5fdb7 commit 5afcdc5Copy full SHA for 5afcdc5
package/Other/StealingApples.php
@@ -43,4 +43,27 @@
43
}
44
45
$i++;
46
-}
+}
47
+
48
+// +----------------------------------------------------------------------
49
+// | 方法二
50
51
+/**
52
+ * @author Openset <[email protected]>
53
+ * @date 2017/9/7
54
+ * @param int $n N个人
55
+ */
56
+for ($r = 1, $n = 5; ; $r++) {
57
+ $t = $r;
58
+ for ($i = 0; $i <= $n; $i++) {
59
+ if ($t % 5 == 1) {
60
+ $t = $t - round($t / 5) - 1;
61
+ } else {
62
+ continue 2;
63
+ }
64
65
+ echo $r;
66
+ break;
67
68
69
+//15621
0 commit comments