Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int oglindit=0;
  6.  
  7. int primaCifra(int x)
  8. {
  9. if(x==0)
  10. return oglindit;
  11. else
  12. {
  13. oglindit=oglindit*10+x%10;
  14. primaCifra(x/10);
  15. }
  16.  
  17. }
  18.  
  19. int main()
  20. {
  21. int x;
  22. cin>>x;
  23. int nr=primaCifra(x);
  24. cout<<nr%10;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement