mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1590 失踪的7 [70' Code]
R38866815
This commit is contained in:
parent
1886b86fde
commit
107a13d7bd
31
problem/P1590/P1590.cpp
Normal file
31
problem/P1590/P1590.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
// 70' Code (R38866815)
|
||||
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
bool find(int s, int x) {
|
||||
while (s) {
|
||||
if (s % 10 == x) {
|
||||
return true;
|
||||
}
|
||||
s /= 10;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int t, n, ans;
|
||||
cin >> t;
|
||||
for (int i = 0; i < t; i++) {
|
||||
cin >> n;
|
||||
ans = 0;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
if (!find(i, 7)) {
|
||||
ans++;
|
||||
}
|
||||
}
|
||||
cout << ans << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user