Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- long long leng;
- std::cin >> leng;
- std::string arr[leng];
- std::string temp;
- long long length_of_leng = cnt_of_num(leng - 1);
- for (long long it = 0; it < leng; ++it) {
- std::cin >> temp;
- if (stoll(temp) >= 0) {
- for (long long i = 0; i < length_of_leng - cnt_of_num(it); ++i) { temp += "0"; }
- temp += std::to_string(it);
- }
- else {
- for ( long long i = 0; i < (length_of_leng - cnt_of_num(pow(10, length_of_leng) - it)); ++i) { temp += "0"; }
- temp += std::to_string(pow(10, length_of_leng) - it);
- }
- arr[it] = temp;
- }
- //qs(arr, 0, leng - 1);
- for (long long it = 0; it < leng; ++it) {
- std::cout << stoll(arr[it]) / (long long)(pow(10, length_of_leng)) << " ";
- }
- std::cout << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement