Untitled

Anonymous
c_cpp
02/11/2024 9:22 AM
360 B
18
Indexable

#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;
}
Editor is loading...
Leave a Comment