Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Day3
//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; }
run
|
edit
|
history
|
help
0
RegExpress
Empty C++
Undefined behavior
Proga1
fb_series
Good1
Meeting_Leandro
sdefrgthyjukiujyhtg
BridgeEdge
ADAKOHL - hpclearn