fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6. int MIN = 1 << ((sizeof(int)*8)-1);
  7. int MAX = ~MIN;
  8.  
  9. cout << MIN << "\n" << MAX << "\n";
  10. cout << hex << MIN << "\n" << hex << MAX << "\n";
  11. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
-2147483648
2147483647
80000000
7fffffff