How come the variable in the while loop keep all the values assigned to it when it gets returned?

前端 未结 0 1375
予麋鹿
予麋鹿 2020-11-27 08:16

class Solution { public: int reverse(int x) {

int reversedNumber = 0, remainder;

while(x != 0) {
    remainder = x%10;
    reversedNumber = reversedNumber*10         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题