关于C语言的问题,请各位专家解答为什么输入2结果输出却是6,不应该是5嘛
int n,i=0,s=0; scanf("%d",&n); while(i<=n){ s+=i*i; i++; } printf("s=%d\n",s);
i和s没有初始化
i没有初始化为1啊