Untitled
Anonymous
c_cpp
02/11/2024 9:31 AM
360 B
15
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 b;
cin >> b;
reverse(b);
return 0;
}Editor is loading...
Leave a Comment