- 306 名前:デフォルトの名無しさん mailto:sage [2018/05/08(火) 23:30:03.25 ID:y0JbAqkN.net]
- >>293 Squeak/Pharo Smalltalk
(1 to: 9) sum * (1 to: 9) "=> #(45 90 135 180 225 270 315 360 405) " ((1 to: 9) * (Array new: 9 withAll: (1 to: 9))) sum. "=> #(45 90 135 180 225 270 315 360 405) " ついでに全段の合計も ((1 to: 9) sum * (1 to: 9)) sum. "=> 2025 " ((1 to: 9) * (Array new: 9 withAll: (1 to: 9))) sum sum. "=> 2025 " (Matrix rows: 9 columns: 9 tabulate: [:x :y | x * y]) sum. "=> 2025 " ((1 to: 9) asArray +* (Matrix rows:1 columns: 9 contents: (1 to: 9))) sum. "=> 2025 "
|

|