[過去ログ]
プログラミングのお題スレ Part13 (1002レス)
プログラミングのお題スレ Part13 http://mevius.5ch.net/test/read.cgi/tech/1549160513/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
888: さすらいの蟻人間 ◆T6xkBnTXz7B0 [sage] 2019/05/10(金) 14:51:58 ID:CF7UUf9v お題: >>877 の入出力を逆転。 http://mevius.5ch.net/test/read.cgi/tech/1549160513/888
889: デフォルトの名無しさん [sage] 2019/05/10(金) 15:12:02 ID:bODSyEKx >>888 手抜きすんな面白くない http://mevius.5ch.net/test/read.cgi/tech/1549160513/889
918: デフォルトの名無しさん [] 2019/05/16(木) 14:34:08 ID:YVMjr/q8 >>888 Go https://ideone.com/x2iyka http://mevius.5ch.net/test/read.cgi/tech/1549160513/918
928: デフォルトの名無しさん [sage] 2019/05/17(金) 00:26:31 ID:SI3/qEwo >>888 Pharo/Squeak Smalltalk | fn | fn := [:arr | String streamContents: [:ss | | cIdx lIdx | cIdx := lIdx := 0. arr do: [:spec | spec third > lIdx ifTrue: [ ss nextPutAll: (String new: spec third - lIdx withAll: Character cr). lIdx := spec third. cIdx := 0 ]. ss nextPutAll: (String new: spec second - cIdx withAll: Character space). ss nextPutAll: spec first. cIdx := spec second + 1. ] ] ]. fn value: #( (a 0 0) (b 2 0) (c 4 0) (d 0 2)). "=> a b c d " http://mevius.5ch.net/test/read.cgi/tech/1549160513/928
932: デフォルトの名無しさん [sage] 2019/05/17(金) 07:54:47 ID:9a+COZnd >>888 s = '''\ [a, 0, 0] [b, 2, 0] [c, 4, 0] [d, 0, 2] ''' from parse import * #pip install col2 = 0 ; line2 = 0 for l in s.splitlines(): col = col2 ; line = line2 r=parse('[{},{},{}]',l) c= r[0] col2 = int(r[1]) ; line2 = int(r[2]) {print() for _ in range(line2-line) } {print(' ',end='') for _ in range(col2-col)} print(c, end='') col2 += 1 print() '''#出力 a b c d ''' http://mevius.5ch.net/test/read.cgi/tech/1549160513/932
933: デフォルトの名無しさん [sage] 2019/05/17(金) 08:32:11 ID:9a+COZnd >>932 parse に型指定追加 >>888 Python s = '''\ [a, 0, 0] [b, 2, 0] [c, 4, 0] [d, 0, 2] ''' from parse import * #pip install col2 = 0 ; line2 = 0 for l in s.splitlines(): col = col2 ; line = line2 (c,col2,line2) = parse('[{},{:d},{:d}]',l) {print() for _ in range(line2-line) } {print(' ',end='') for _ in range(col2-col)} print(c, end='') col2 += 1 print() '''#出力 a b c d ''' http://mevius.5ch.net/test/read.cgi/tech/1549160513/933
989: デフォルトの名無しさん [sage] 2019/05/18(土) 15:45:24 ID:kdcwh9zo >>888 Perl5 @a=([a, 0, 0], [b, 2, 0], [c, 4, 0], [d, 0, 2]); sub {$t[$_[2]][$_[1]] = $_[0]}->(@$_) for @a; @b = map{[map{$_ // ' '} @$_]} map{[@$_]} @t; undef $"; $s = join'', map{"@$_\n"} @b; print $s; 実行 ~ $ perl 13_888.pl a b c d http://mevius.5ch.net/test/read.cgi/tech/1549160513/989
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.029s