Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let name = input.shift()
- let obshto = 0
- let n = 0
- while (n < 12) {
- let sum = Number(input.shift())
- obshto += sum
- n++
- }
- if (obshto >= 4) {
- console.log(`${name} graduated. Average grade: ${(obshto / 12).toFixed(2)} `)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment