Untitled

mail@pastecode.io avatar
unknown
c_cpp
19 days ago
268 B
0
Indexable
Never

#include <iostream>
using namespace std;


void reverse(int a) {
	int rev = 0;
	while (a != 0) {
		int digit = a % 10;
		rev = rev * 10 + digit;
		a /= 10;
	}
	cout << rev << endl;
}

int main() {
	int a;
	cin >> a;

	reverse(a);

	return 0;
}
Leave a Comment