[過去ログ]
プログラミングのお題スレ Part13 (1002レス)
プログラミングのお題スレ Part13 http://mevius.5ch.net/test/read.cgi/tech/1549160513/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
748: デフォルトの名無しさん [sage] 2019/03/21(木) 22:33:42.92 ID:4Lv8Ku6J >>723 Squeak Smalltalk | fn | fn := [:int1 :int2 | | strings width digits interms ans max line | strings := {int1. int2} collect: #asString. width := (strings detectMax: #size) size. digits := strings collect: [:str | (str forceTo: width paddingStartWith: $0) reversed asArray collect: #asString]. interms := (digits reduce: #+) collectWithIndex: [:interm :idx | interm, (String new: idx-1 withAll: Character space)]. ans := interms polynomialEval: '10'. strings atLast: 1 put: '+ ', strings last. max := ((strings, {ans}) collect: #size) max. line := String new: max withAll: $-. (strings, {line}, interms, {line. ans} collect: [:str | (str forceTo: max paddingStartWith: Character space) withoutTrailingBlanks ]) asStringWithCr ]. fn value: 987 value: 65. "=> ' 987 + 65 ---- 12 14 9 ---- 1052' " http://mevius.5ch.net/test/read.cgi/tech/1549160513/748
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 254 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.017s