Advertisement
catalyn

12.11.2014 concat

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