Код: Выделить всё
class Solution {
public:
int hammingWeight(int n) {
if(n==0){
return 0;
}else{
int a=1;
while(a
Подробнее здесь: [url]https://stackoverflow.com/questions/79010887/overflow-while-attempting-to-calculate-the-hemming-weight-in-c[/url]