Adding numbers larger than long long in C++

前端 未结 4 1573
庸人自扰
庸人自扰 2020-12-20 10:26

I want to add two numbers which is the largest values that a long long integer can hold; and print it. If I don\'t store the value of sum in a variable, I just print it usin

4条回答
  •  天命终不由人
    2020-12-20 11:24

    No, at first it counts (theLastValueOfLongLong + theLastValueOfLongLong) (which causes overflow or freezes at max value available) and then it sends result into cout.<<(long long) operator

提交回复
热议问题