Skip to content

Above average · ⁨高于平均数⁩

English

Above average

Two loops, one after the other: the first works out the average, the second keeps the numbers above it.

This joins two patterns you have already used, the running total and the filter. Solving a problem in stages like this is how most longer programs are built.

中文

高于平均数

两个循环,一个接一个:第一个算出平均数,第二个留下比它大的数。

这把你用过的两种方法结合了起来:累计求和与筛选。像这样分步骤解决问题,是大多数较长程序的写法。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩