Advertisement
Dizzy3113

Untitled

Nov 17th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int numar(int a, int b)
  6. {
  7. int r=0;
  8. int p=1;
  9. for(int i=0; i<=b; i++)
  10. {
  11. r=0+p*(a%10);
  12. p=p*10;
  13. a=a/10;
  14. }
  15. while(a)
  16. {
  17. r=r+p*(a%10);
  18. p=p*10;
  19. a=a/10;
  20. }
  21. return r;
  22. }
  23. int main()
  24. {
  25. cout<<numar(184465709, 5);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement