parent
e5e907beae
commit
a66b1df1c6
@ -0,0 +1,20 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
#include <iostream>
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
https://blog.csdn.net/qq_36230375/article/details/134725732
|
||||||
|
|
||||||
|
https://tiku.scratchor.com/paper/view/gjfvsjrgtpm30v3f
|
Loading…
Reference in new issue