|
|
|
@ -49,14 +49,14 @@ function calculateSum(){
|
|
|
|
|
|
|
|
|
|
|
|
for (const num of numbers){
|
|
|
|
for (const num of numbers){
|
|
|
|
if (num === numbers[0]){
|
|
|
|
if (num === numbers[0]){
|
|
|
|
a += num;
|
|
|
|
a = num;
|
|
|
|
i++;
|
|
|
|
//i++;
|
|
|
|
console.log(`step ${i}: ${a}`);
|
|
|
|
//console.log(`step ${i}: ${a}`);
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
a += a + num;
|
|
|
|
a = a + num;
|
|
|
|
i++;
|
|
|
|
//i++;
|
|
|
|
console.log(`step ${i}: ${a}`);
|
|
|
|
//console.log(`step ${i}: ${a}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|