結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
👑 |
提出日時 | 2019-05-01 09:33:02 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
WA
|
実行時間 | - |
コード長 | 311 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 12:10:50 |
合計ジャッジ時間 | 878 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 8 |
ソースコード
local orig = io.read("*n") local t = {} while(0 < orig) do local a = orig % 10 table.insert(t, a) orig = math.floor(orig / 10) end local maxdig = 1 for i = 2, #t do if(t[maxdig] < t[i]) then maxdig = i end end t[#t], t[maxdig] = t[maxdig], t[#t] for i = #t, 1, -1 do io.write(t[i]) end io.write("\n")