From 6450b758663dac22b01a3394dd8a5afbf7f71571 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Wed, 14 Oct 2020 20:57:12 +0800 Subject: [PATCH] P6449 [COCI2008-2009#4] B R39810661 --- problem/P6449/P6449.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 problem/P6449/P6449.cpp diff --git a/problem/P6449/P6449.cpp b/problem/P6449/P6449.cpp new file mode 100644 index 00000000..118782f9 --- /dev/null +++ b/problem/P6449/P6449.cpp @@ -0,0 +1,32 @@ +#include + +using namespace std; + +int main() { + int d, m, z = 3; + cin >> d >> m; + for (int i = 1; i < m; i++) { + int n = 30; + if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) { + n = 31; + } + else if (i == 2) { + n = 28; + } + for (int j = 1; j <= n; j++) { + z++; + if (z == 8) { + z = 1; + } + } + } + for (int i = 1; i <= d; i++) { + z++; + if (z == 8) { + z = 1; + } + } + string ans[] = {"", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; + cout << ans[z] << endl; + return 0; +}