From a66b1df1c69fba38bf5ed888330a890887d52047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Fri, 23 Feb 2024 08:47:45 +0800 Subject: [PATCH] 'commit' --- .../LanQiaoBei/LanQiao14STEMA20230212/2.cpp | 20 +++++++++++++++++++ .../LanQiaoBei/LanQiao14STEMA20230212/8.cpp | 18 +++++++++++++++++ .../LanQiao14STEMA20230212/题解.md | 3 +++ 3 files changed, 41 insertions(+) create mode 100644 TangDou/LanQiaoBei/LanQiao14STEMA20230212/2.cpp create mode 100644 TangDou/LanQiaoBei/LanQiao14STEMA20230212/8.cpp create mode 100644 TangDou/LanQiaoBei/LanQiao14STEMA20230212/题解.md diff --git a/TangDou/LanQiaoBei/LanQiao14STEMA20230212/2.cpp b/TangDou/LanQiaoBei/LanQiao14STEMA20230212/2.cpp new file mode 100644 index 0000000..5dd0d91 --- /dev/null +++ b/TangDou/LanQiaoBei/LanQiao14STEMA20230212/2.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int main() { + int n, m; + cin >> n >> m; + int cnt = 0; + for (int i = n; i <= m; i++) { + int x = i; + bool flag = false; + while (x) { + int a = x % 10; + if (a % 2 == 0) flag = true; + x /= 10; + } + if (!flag) cnt++; + } + cout << cnt << endl; + + return 0; +} diff --git a/TangDou/LanQiaoBei/LanQiao14STEMA20230212/8.cpp b/TangDou/LanQiaoBei/LanQiao14STEMA20230212/8.cpp new file mode 100644 index 0000000..3ea813d --- /dev/null +++ b/TangDou/LanQiaoBei/LanQiao14STEMA20230212/8.cpp @@ -0,0 +1,18 @@ +#include +using namespace std; +int main() { + int n, cnt = 0; + cin >> n; + cnt = n / 3; + if (n == 2) + cnt = -1; + else if (n == 4) + cnt = 4; + else if (n % 3 == 1) + cnt += 1; + else if (n % 3 == 2) + cnt += 2; + + cout << cnt << endl; + return 0; +} \ No newline at end of file diff --git a/TangDou/LanQiaoBei/LanQiao14STEMA20230212/题解.md b/TangDou/LanQiaoBei/LanQiao14STEMA20230212/题解.md new file mode 100644 index 0000000..7bc7009 --- /dev/null +++ b/TangDou/LanQiaoBei/LanQiao14STEMA20230212/题解.md @@ -0,0 +1,3 @@ +https://blog.csdn.net/qq_36230375/article/details/134725732 + +https://tiku.scratchor.com/paper/view/gjfvsjrgtpm30v3f \ No newline at end of file