Untitled
unknown
c_cpp
2 years ago
268 B
6
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