1999-06-01から1日間の記事一覧

配列の各要素に先頭から順に 1,2,3,4,5 を代入して表示 (for文)

明解C言語 入門編 > 5. 配列 > 配列の各要素に先頭から順に 1,2,3,4,5 を代入して表示 (for文) Ruby score = [] for i in 0..4 score[i] = i + 1 end for i in 0..4 printf("点数%d = %d\n", i + 1, score[i]) end 実行結果 L:\>ruby l:\lesson_05…