Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include <iostream>
- using namespace std;
- class Zerkal
- {
- public:
- int N;
- int P = 0;
- int zercalo(int N)
- {
- while (N != 0)
- {
- P = P * 10;
- P = P + N % 10;
- N = N / 10;
- }
- return P;
- }
- };
- int main()
- {
- setlocale(LC_ALL, "Rus");
- int buf;
- cout << "Перезапиcать число в обратном порядке" << endl;
- cout << "Введите число = ";
- cin >> buf;
- Zerkal examp;
- examp.N = buf;
- cout << "Результат обратного порядка числа равен = " <<examp.zercalo(buf) ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement