結果

問題 No.3022 縛りFizzBuzz (Easy)
ユーザー ardggyardggy
提出日時 2021-02-12 01:14:51
言語 Nim
(2.0.2)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 2,946 ms
コンパイル使用メモリ 67,764 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 15:05:02
合計ジャッジ時間 4,285 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils

const zero = ord('@') - ord('@')
const one = ord('A') - ord('@') 
const two = ord('B') - ord('@') 
const three = ord('C') - ord('@') 
const four = ord('D') - ord('@') 
const five = ord('E') - ord('@') 
const six = ord('F') - ord('@') 
const seven = ord('G') - ord('@') 
const eight = ord('H') - ord('@') 
const nine = ord('I') - ord('@') 

proc main() =
  let n = stdin.readLine.parseInt
  for i in one..n:
    if i %% (three * five) == zero: echo "FizzBuzz"
    elif i %% five == zero: echo "Buzz"
    elif i %% three == zero: echo "Fizz"
    else: echo i

when isMainModule: main()
0