问题的原因和解法都写在注释上了
#include <stdio.h> int main() { int a=0; scanf("%d",&a); int b=0; if(a==6 && (b=b+1)>0) printf("%d",b); return 0; }