Skip to content
← Back to Community
6.7. While: Average of sequence
Profile icon
pole55

Given a sequence of non-negative integers, where each number is written in a separate line. The sequence ends with 0. Print the average of the sequence.

Example input
10
30
0

Example output
20.0

Voters
Profile icon
S2A24OUYANG
Profile icon
Charanteja28
Profile icon
SwethaV
Profile icon
nharumi
Profile icon
TimothyDoan
Profile icon
CristopherHu
Profile icon
aximran7
Profile icon
Nourrisha
Profile icon
pole55