0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 16:32:17 +00:00
OI-codes/Luogu/P1590/P1590.cpp

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;
}