缺少“;”(在“类型”的前面)怎么解决,


#define _CRT_SECURE_NO_WARNINGS 1
#include
int abc(int n)
{
    int count=0;
    while(n)
    {
        if(n%2==1)
        {
            count++;
        }
        n=n/2;
    }
    return count;

}
int main()
{
    int a=0;
    int count=0;
    scanf("%d",&a);
    int count=abc(a);  缺少“;”(在“类型”的前面)

    printf("count=%d\n",count);
    return 0;

}

```c


```

count定义了2次。
count=abc(a); 即可

你的count定义了两遍

看楼上回答,和题主回复,你电脑运行不行,别人电脑行?
建议关机重启。