fork download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <vector>
  4. #include <string>
  5.  
  6. class BigInt
  7. {
  8. //
  9. public:
  10. //
  11. BigInt(std::string integer);
  12. void ShowBigIntVector();
  13.  
  14. private:
  15. //
  16. std::vector< char > BigIntVector;
  17. std::string integer;
  18.  
  19. };
  20.  
  21.  
  22. #include <iostream>
  23. #include <algorithm>
  24. #include <vector>
  25. #include <string>
  26. //#include "BigInt.h"
  27. //#include "BigInt.cpp"
  28.  
  29. int main(int argc, char** argv) {
  30.  
  31. BigInt num1("12345678987654321");
  32. num1.ShowBigIntVector();
  33.  
  34. return 0;
  35. }
  36.  
  37.  
  38. #include <iostream>
  39. #include <algorithm>
  40. #include <vector>
  41. #include <string>
  42. //#include "BigInt.h"
  43.  
  44. BigInt::BigInt(std::string integer)
  45. {
  46. //
  47. this->integer = integer;
  48.  
  49. for(std::string::iterator it = this->integer.begin(); it != this->integer.end(); ++it)
  50. {
  51. //std::cout << *it << std::endl;
  52. this->BigIntVector.push_back(*it);
  53. //std::cout << this->BigIntVector[0];
  54. }
  55. }
  56.  
  57. void BigInt::ShowBigIntVector()
  58. {
  59. //
  60. for( int i = 0; i < this->BigIntVector.size(); i++ )
  61. {
  62. //
  63. std::cout << this->BigIntVector[i];
  64. }
  65.  
  66. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
12345678987654321