Demo entry 3818942

swift

   

Submitted by anonymous on Feb 29, 2016 at 07:07
Language: Swift. Code size: 207 Bytes.

let individualScores = [75, 43, 103, 87, 12]
var teamScore = 0
for score in individualScores {
    if score > 50 {
        teamScore += 3
    } else {
        teamScore += 1
    }
}
print(teamScore)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).