fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. #include <limits>
  4.  
  5. using std::cout;
  6. using std::endl;
  7. using std::numeric_limits;
  8. using std::cerr;
  9.  
  10. int main() {
  11. auto i = 2147483647L /* numeric_limits<int>::max() */ ;
  12. cout << "The type of i is " << typeid(i).name() << endl;
  13.  
  14. int count = 0;
  15. for (auto i = 2147483647L;
  16. i < 2147483657L /* numeric_limits<int>::max() + 10 */ ; ++i) {
  17. cout << "i = " << i << " " << endl;
  18.  
  19. if (count > 30) {
  20. cerr << "Too many loops." << endl;
  21. break;
  22. }
  23. ++count;
  24. }
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
The type of i is l
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647 
i = 2147483647