fork download
  1. #include <iostream>
  2. #include <cstdint>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. unsigned long long int s1;
  8. s1 = 191689628 + 646033877 + 109099622 + 798412961 + 767677318 + 190145527 + 199698411;
  9. cout << s1 << endl;
  10.  
  11. // long is 64bit in this compiler!
  12. /*unsigned long int*/uint32_t s2;
  13. s2 = 191689628 + 646033877 + 109099622 + 798412961 + 767677318 + 190145527 + 199698411;
  14. cout << s2 << endl;
  15.  
  16. s1 = 191689628ULL + 646033877ULL + 109099622ULL + 798412961ULL + 767677318ULL + 190145527ULL + 199698411ULL;
  17. cout << s1 << endl;
  18.  
  19. s2 = 191689628UL + 646033877UL + 109099622UL + 798412961UL + 767677318UL + 190145527UL + 199698411UL;
  20. cout << s2 << endl;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5384KB
stdin
Standard input is empty
stdout
18446744072317341664
2902757344
2902757344
2902757344