0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-06 03:18:47 +00:00
OI-codes/Luogu/problem/P1590/P1590.cpp
2021-09-15 18:22:51 +08:00

20 lines
317 B
C++

#include <bits/stdc++.h>
using namespace std;
long long t, n, m, ans;
int main() {
cin >> t;
while (t--) {
ans = m = 0;
cin >> n;
while (n) {
ans += (n % 10 - (n % 10 > 7)) * pow(9, m++);
n /= 10;
}
cout << ans << endl;
}
return 0;
}