Skip to content

Commit 11b37cd

Browse files
committed
修改代码格式
1 parent e52af53 commit 11b37cd

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

alphabet_position/alphabet_position.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function alphabet_position(string $s): string
1313
$letterArr = [1 => 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
1414
// 将参数$s全部小写, 转换为目标数组
1515
$targetArr = str_split(strtolower($s));
16-
$result = '';
16+
$result = '';
1717
// 循环目标数组
1818
foreach ($targetArr as $value) {
1919
// 循环字母表数组

find/find.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
function find($integers)
1111
{
12-
$odd = []; //偶数数组
12+
$odd = []; //偶数数组
1313
$even = []; // 奇数数组
1414
foreach ($integers as $value) {
1515
// 判断元素是否奇偶数
@@ -20,7 +20,7 @@ function find($integers)
2020
array_push($even, $value);
2121
}
2222
}
23-
// 判断偶数数组个数, 等于1, 说明该$integers数组有偶数
23+
// 判断偶数数组个数, 等于1, 说明该 $integers数组有偶数
2424
if (count($odd) == 1) {
2525
return $odd[0];
2626
}

format_duration/format_duration.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ function format_duration($seconds)
1313
if ($seconds == 0) return 'now';
1414
// 时间计算数组
1515
$date = [
16-
'year' => 60 * 60 * 24 * 365,
17-
'day' => 60 * 60 * 24,
18-
'hour' => 60 * 60,
16+
'year' => 60 * 60 * 24 * 365,
17+
'day' => 60 * 60 * 24,
18+
'hour' => 60 * 60,
1919
'minute' => 60,
2020
'second' => 1
2121
];

thirt/thirt.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
*/
1414
function thirt($n) {
1515
$sequence = [1,10,9,12,3,4];
16-
$sum = 0;
16+
$sum = 0;
1717
// 将字符串转换为数组, 再把数组相反
18-
$arr = array_reverse(str_split($n));
18+
$arr = array_reverse(str_split($n));
1919
// 循环数组
2020
for ($i = 0; $i < count($arr); $i++) {
2121
// 通过余数来循环出$sequence数组的值 因为$sequence有6个所以除于6求余数.

0 commit comments

Comments
 (0)