daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Dec 17th, 2018 115 in 144 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3.  
  4. #include <vector>
  5. testBigInteger<BigInteger>();
  6.  
  7.  
  8. template<typename T> void testBigInteger() {
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. T b, k;
  19. b = 0; k = 1234567;
  20.  
  21. oss << b << ' ' << k;
  22.  
  23.  
  24.  
  25.  
  26. T a = b;
  27. a = -a;
  28. std::string testString = a.toString() + " " + (-k).toString();
  29.  
  30.  
  31.  
  32.  
  33. a = 999, b = 1000;
  34. a = a += a;
  35. testString = a.toString();
  36.  
  37.  
  38.  
  39.  
  40.  
  41. ++a %= a /= a *= a -= b++;
  42.  
  43. oss2 << 5+a << ' ' << 1-b; // 5 -1000
  44.  
  45.  
  46.  
  47.  
  48.  
  49. oss3 << (a = (bool(a) ? -1 : -2));
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  iss >> a >> b;
  56.  
  57. oss4 << b << ' ' << a << ' ';
  58.  
  59.  
  60.  
  61.  
  62. oss4 << a+b << ' ' << a-b << ' ' << a*b << ' ' << a/b << ' ' << a%b << '\n';
  63. oss4 << b+a << ' ' << b-a << ' ' << b*a << ' ' << b/a << ' ' << b%a;
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. v.push_back(1000 - i);
  71.  
  72.  
  73.  
  74.  
  75. oss5 << v[0] << ' ' << v[500] << ' ' << v[999] << ' ';
  76.  
  77. oss5 << (a != b) << ' ' << (a < b) << ' ' << (a > b) << ' ';
  78. oss5 << (a <= b) << ' ' << (a >= b);
  79.  
  80.  
  81.  
  82.  
  83.  
  84. iss2 >> a >> b;
  85.  
  86. oss6 << b << a;
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. T c, d;
  94. iss3 >> c >> d;
  95.  
  96.  
  97.  
  98. T e, f;
  99. iss4 >> e >> f;
  100.  
  101.  
  102. oss7 << a+b << ' ' << c+d << ' ' << e+f;
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110. oss8 << a-b << ' ' << c-d << ' ' << e-f;
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. oss9 << a*b << ' ' << c*d << ' ' << e*f;
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. oss10 << a/b << ' ' << c/d << ' ' << e/f;
  127.  
  128.  
  129.  
  130.  
  131.  
  132. oss11 << a%b << ' ' << c%d << ' ' << e%f;
  133.  
  134.  
  135.  
  136.  
  137.  
  138. T xxx = 1000000000, y = 2;
  139. xxx *= xxx;
  140. xxx %= 2;
  141.  
  142. T x5 = 5;
  143. T x10 = -10;
  144.  
  145. oss12 << x5 + x10;
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  T a, b;
  154. iss13 >> a >> b;
  155. if (a * a * a * a != b || !(b == a * a * a * a)) {
  156.  
  157.  
  158. if (a * a * a * a == b + T(1000000000) * T(10000) || !(b + 5 != a * a * a * a)) {
  159.  
  160.  
  161.  
  162. if (a * a * a * a - b != -b + a * a * a * a) {
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. for (T a, b; iss14 >> a >> b; ) {
  170.     if (a != b || !(a == b) || a != T(0) || !(a == T(0)) || T(0) != b || !(T(0) == b)) {
  171.    
  172.    
  173.     if (a > b || a < b || !(a >= b) || !(a <= b)) {
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top