結果
問題 | No.593 4進FizzBuzz |
ユーザー |
👑 |
提出日時 | 2019-03-30 00:21:05 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 338 bytes |
コンパイル時間 | 57 ms |
コンパイル使用メモリ | 6,692 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-11-07 01:34:33 |
合計ジャッジ時間 | 4,752 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 31 |
ソースコード
s = io.read()n = string.len(s)a, b = 0, 0for i = 1, n doc = tonumber(string.sub(s, i, i))a = a + cif(i % 2 == 0) then b = b + c else b = b - c endenda, b = a % 3, b % 5if(a ~= 0 and b ~= 0) thenprint(s)elseif(a == 0) then io.write("Fizz") endif(b == 0) then io.write("Buzz") endio.write("\n")end