Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -8,10 +8,19 @@ public class Average {
private static final double SMALL_VALUE = 0.00001f;
public static void main(String[] args) {
assert Math.abs(average(new double[]{3, 6, 9, 12, 15, 18, 21}) - 12) < SMALL_VALUE;
assert Math.abs(average(new double[]{5, 10, 15, 20, 25, 30, 35}) - 20) < SMALL_VALUE;
assert Math.abs(average(new double[]{1, 2, 3, 4, 5, 6, 7, 8}) - 4.5) < SMALL_VALUE;
int[] array = {2, 4, 10};
assert Math.abs(
average(new double[] { 3, 6, 9, 12, 15, 18, 21 }) - 12
) <
SMALL_VALUE;
assert Math.abs(
average(new double[] { 5, 10, 15, 20, 25, 30, 35 }) - 20
) <
SMALL_VALUE;
assert Math.abs(
average(new double[] { 1, 2, 3, 4, 5, 6, 7, 8 }) - 4.5
) <
SMALL_VALUE;
int[] array = { 2, 4, 10 };
assert average(array) == 5;
}