結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー 👑 obakyan
提出日時 2019-03-27 23:46:40
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 219 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 06:16:06
合計ジャッジ時間 1,216 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

sum = 0
for i = 1, 5 do
    n = io.read("*n")
    s = tostring(n)
    if(n % 15) == 0 then sum = sum + 8
    elseif (n % 3 == 0 or n % 5 == 0) then sum = sum + 4
    else sum = sum + string.len(s)
    end
end
print(sum)
0