Polnochniy

Untitled

Nov 6th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. setlocale(LC_ALL, "Rus");
  6. int N;
  7. int P = 0;
  8. cout << "Введите число = " ;
  9. cin >> N;
  10. for (P=0 ;N!=0 ; P=P*10 )
  11. {
  12. P = P + N % 10;
  13. N = N / 10;
  14. }
  15. cout << "Результат обратного порядка числа равен = " << P/10;
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment