Commit f3587919 authored by Nurasyl's avatar Nurasyl

fix

parent b6f75697
......@@ -18,28 +18,26 @@ function showResult(arr) {
};
function counterGroup(arr, num) {
for(let i = 0; i < num; i++) {
if(num >= 0 && num <= 9) {
arr[0]++;
} else if(num >= 10 && num <= 19) {
arr[1]++;
} else if(num >= 20 && num <= 29) {
arr[2]++;
} else if(num >= 30 && num <= 39) {
arr[3]++;
} else if(num >= 40 && num <= 49) {
arr[4]++;
} else if(num >= 50 && num <= 59) {
arr[5]++;
} else if(num >= 60 && num <= 69) {
arr[6]++;
} else if(num >= 70 && num <= 79) {
arr[7]++;
} else if(num >= 80 && num <= 89) {
arr[8]++;
} else if(num >= 90 && num <= 99) {
arr[9]++;
};
if(num >= 0 && num <= 9) {
arr[0]++;
} else if(num >= 10 && num <= 19) {
arr[1]++;
} else if(num >= 20 && num <= 29) {
arr[2]++;
} else if(num >= 30 && num <= 39) {
arr[3]++;
} else if(num >= 40 && num <= 49) {
arr[4]++;
} else if(num >= 50 && num <= 59) {
arr[5]++;
} else if(num >= 60 && num <= 69) {
arr[6]++;
} else if(num >= 70 && num <= 79) {
arr[7]++;
} else if(num >= 80 && num <= 89) {
arr[8]++;
} else if(num >= 90 && num <= 99) {
arr[9]++;
};
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment