Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Day3
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
//g++ 7.4.0 #include <iostream> using namespace std; int main() { int d, m, y, sum = 0; bool check = true; cin >> d >> m >> y; if ((y % 100 == 0 && y % 400 == 0) ||(y % 100 != 0 && y % 4 == 0)) check = true; else check = false; for (int i = 1; i < m; i++) { if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) sum += 31; else if (i == 4 || i == 6 || i == 9 || i == 11) sum += 30; else { if (check == true) sum += 29; else sum += 28; } } sum += d; cout << "Ngay " << d << "/" << m << "/" << y << " la ngay thu " << sum << " cua nam " << y; return 0; }
g++
31 12 2004
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.42 sec, absolute running time: 0.16 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 0,67 sec
edit mode
|
history
|
discussion
Ngay 31/12/2004 la ngay thu 366 cua nam 2004