Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Leap Year or Not
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#How to find something is leap year or not demo = readLines(file("stdin"), warn = FALSE) year = as.integer(demo) if(((year %% 4) == 0) && ((year %% 100) == 0) & ((year %% 400) == 0)) { print(paste(year, "is a leap year")) }else { print(paste(year, "is not a leap year")) }
2000
[
-
]
Show input
Absolute running time: 0.63 sec, cpu time: 0.64 sec, memory peak: 30 Mb, absolute service time: 0,64 sec
edit mode
|
history
|
discussion
[1] "2000 is a leap year"