3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Nim言語でうるう年を判定する

Last updated at Posted at 2024-08-04

Nimの標準モジュールである、std/timesにうるう年であるか判定する関数(isLeapYear)が存在する。

例(ABC365-A)

問題概要

1583以上2023以下の整数Yが与えられるので、西暦Y年の日数を求めてください。

解答コード

import times,strutils

let Y = stdin.readLine().parseInt()

if isLeapYear(Y):
  echo 366
else:
  echo 365
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?