Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- string Convert(int n) {
- string temp = "";
- while (n > 0) {
- int digit = n % 10;
- temp += (1, (char) '0' + digit);
- n /= 10;
- }
- reverse(temp.begin(), temp.end());
- return temp;
- }
- int main() {
- int n;
- cin >> n;
- cout << Convert(n) << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment