0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 10:31:59 +00:00
OI-codes/Luogu/P1590/P1590.cpp

20 lines
317 B
C++
Raw Normal View History

2020-09-26 11:39:31 +00:00
#include <bits/stdc++.h>
using namespace std;
2021-09-15 10:22:51 +00:00
long long t, n, m, ans;
2020-09-26 11:39:31 +00:00
int main() {
cin >> t;
2021-09-15 10:22:51 +00:00
while (t--) {
ans = m = 0;
2020-09-26 11:39:31 +00:00
cin >> n;
2021-09-15 10:22:51 +00:00
while (n) {
ans += (n % 10 - (n % 10 > 7)) * pow(9, m++);
n /= 10;
2020-09-26 11:39:31 +00:00
}
cout << ans << endl;
}
return 0;
}