On palindrome problem: find and output the number m between 11 and 999, which satisfies that m, M2 and M3 are palindrome numbers, while (k) return0return 1 int jsValue(long n) {long int s=0,k; k=n; while(k) { s=s*10+k%10; k/=10; } if(s==n) return 1; if(s!=n) return 0; } What does "while (k)" mean? If s = = n, return N1, return N1 is what step to perform

On palindrome problem: find and output the number m between 11 and 999, which satisfies that m, M2 and M3 are palindrome numbers, while (k) return0return 1 int jsValue(long n) {long int s=0,k; k=n; while(k) { s=s*10+k%10; k/=10; } if(s==n) return 1; if(s!=n) return 0; } What does "while (k)" mean? If s = = n, return N1, return N1 is what step to perform


Because there is K / = 10 in the while statement, every time the loop, K will be cut off by an order of magnitude, such as k = 12345, after running, k = 1234, k = 123, k = 12, k = 1, k = 0; when k = 0, while (k) ends the loop due to the condition k = 0. The return type of your function jsvalue() is int, so return 1 is to return a value 1