Skip to content

Instantly share code, notes, and snippets.

@likecs
Last active November 20, 2017 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save likecs/ad044924fe0a419b3e771a5088ddbc4a to your computer and use it in GitHub Desktop.
Save likecs/ad044924fe0a419b3e771a5088ddbc4a to your computer and use it in GitHub Desktop.
Model Solution of GEEK02
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int t, n;
cin >> t;
assert(1 <= t && t <= 100);
while(t--) {
cin >> n;
assert(0 <= n && n <= 10000);
if (n == 0) {
cout << "0\n";
continue;
}
if (n % 9 != 0) {
cout << (n % 9);
}
for(int i = 1; i <= (n/9); ++i) {
cout << "9";
}
for(int i = 1; i <= n; ++i) {
cout << "0";
}
cout << "\n";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment