fork(3) download
  1.  
  2. #include<iostream>
  3. #include<fstream>
  4. #include<algorithm>
  5. #include<vector>
  6. #include<cmath>
  7. #define bigint long long unsigned int
  8. using namespace std;
  9.  
  10.  
  11. bigint base(int a , int b)
  12. {
  13. bigint t=0;
  14. bigint l = 0;
  15. int n=0,r[100];
  16.  
  17. while(a)
  18. {
  19. r[n] = a % b;
  20.  
  21. a /= b;
  22. n++;
  23. }
  24.  
  25.  
  26. for(int i=0;i<n;i++)
  27. {
  28.  
  29. t += ((r[i])*pow(10,i));
  30.  
  31. }
  32.  
  33. return t;
  34.  
  35.  
  36. }
  37.  
  38.  
  39.  
  40. int main()
  41. {
  42.  
  43.  
  44. cout<< base(1025,15);
  45. return 0;
  46.  
  47.  
  48.  
  49. }
  50.  
  51.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
485