Untitled
#include <iostream> #include <cmath> using namespace std; int ch(int a) { int c = 0; while (a != 0) { int b = a % 10; c = c * 10 + b; a /= 10; } return c; } int main() { int a; cin >> a; int c = ch(a); cout << c; return 0; }
Leave a Comment
#include <iostream> #include <cmath> using namespace std; int ch(int a) { int c = 0; while (a != 0) { int b = a % 10; c = c * 10 + b; a /= 10; } return c; } int main() { int a; cin >> a; int c = ch(a); cout << c; return 0; }