コンテンツへスキップ

A row of Pascal's triangle

パスカル三角形の一行

Every number in Pascal's triangle is the sum of the two numbers just above it, and every row starts and ends with 1.

行を1つずつ作成します。新しい行は 1 で始まり、前の行の隣り合うペアを順に row[i] + row[i + 1] として加え、 1 で終わります。 n 回繰り返すと、 row が答えになります。中国では、この三角形は楊輝によって 1261 で記述されたことにちなんで「楊輝三角」と呼ばれています。

ログインまたはアカウント作成

IGCSE, A-Level & AP