This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

18
LuoGu/RuMen/P1179.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll a, b, s = 0, n;
cin >> a >> b;
for (ll y = a; y <= b; y++) {
n = y;//不能改变循环变量的原值,所以要找“替身”
while (n != 0) {
if (n % 10 == 2) s++;
n /= 10;
}
}
cout << s << endl;
return 0;
}