fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a = 0x80000000;
  6. int b = a + 0x7f;
  7. int c = a + 0x80;
  8. int d = 0xffffff80;
  9. int e = a + d;
  10. printf("%x\t%d\n%x\t%d\n%x\t%d\n%x\t%d\n%x\t%d\n",
  11. a,a,
  12. b,b,
  13. c,c,
  14. d,d,
  15. e,e);
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5444KB
stdin
Standard input is empty
stdout
80000000	-2147483648
8000007f	-2147483521
80000080	-2147483520
ffffff80	-128
7fffff80	2147483520