Advertisement
tien_noob

LOJ - 1163 - Bank Robbery

Jun 10th, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. //Make CSP great again
  2. #include <bits/stdc++.h>
  3. #define TASK "TESTCODE"
  4. using namespace std;
  5. long long a;
  6. void read()
  7. {
  8.    cin >> a;
  9. }
  10. void solve()
  11. {
  12.    for (int i = 9; i >= 0; -- i)
  13.    {
  14.        if ((a - i) % 9 == 0)
  15.        {
  16.            long long tmp = (a - i)/9;
  17.            if (tmp > 0)
  18.            {
  19.                cout << tmp*10 + i << ' ';
  20.            }
  21.        }
  22.    }
  23.    cout << '\n';
  24. }
  25. int main()
  26. {
  27.     ios_base::sync_with_stdio(false);
  28.     cin.tie(nullptr);
  29.     //freopen(TASK".INP", "r", stdin);
  30.     //freopen(TASK".OUT", "w", stdout);
  31.     int t = 1;
  32.     bool typetest = true;
  33.     if (typetest)
  34.     {
  35.         cin >> t;
  36.     }
  37.     for (int __ = 1; __ <= t; ++ __)
  38.     {
  39.         cout << "Case " << __ << ": ";
  40.         read();
  41.         solve();
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement