看一下这个题错在哪?题目是:从键盘输入几个数,以0作为结束标志,判断其正负,并求其平方和.void main(){ int n,m[100],counter=0; long int sum=0; while(1) { printf("please input a number:"); scanf("%d",&m[n]);
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/09 09:18:34
![看一下这个题错在哪?题目是:从键盘输入几个数,以0作为结束标志,判断其正负,并求其平方和.void main(){ int n,m[100],counter=0; long int sum=0; while(1) { printf(](/uploads/image/z/10262011-67-1.jpg?t=%E7%9C%8B%E4%B8%80%E4%B8%8B%E8%BF%99%E4%B8%AA%E9%A2%98%E9%94%99%E5%9C%A8%E5%93%AA%3F%E9%A2%98%E7%9B%AE%E6%98%AF%EF%BC%9A%E4%BB%8E%E9%94%AE%E7%9B%98%E8%BE%93%E5%85%A5%E5%87%A0%E4%B8%AA%E6%95%B0%2C%E4%BB%A50%E4%BD%9C%E4%B8%BA%E7%BB%93%E6%9D%9F%E6%A0%87%E5%BF%97%2C%E5%88%A4%E6%96%AD%E5%85%B6%E6%AD%A3%E8%B4%9F%2C%E5%B9%B6%E6%B1%82%E5%85%B6%E5%B9%B3%E6%96%B9%E5%92%8C.void+main%28%29%7B++int+n%2Cm%5B100%5D%2Ccounter%3D0%3B++long+int+sum%3D0%3B++while%281%29++%7B++++printf%28%22please+input+a+number%3A%22%29%3B++++scanf%28%22%25d%22%2C%26m%5Bn%5D%29%3B)
看一下这个题错在哪?题目是:从键盘输入几个数,以0作为结束标志,判断其正负,并求其平方和.void main(){ int n,m[100],counter=0; long int sum=0; while(1) { printf("please input a number:"); scanf("%d",&m[n]);
看一下这个题错在哪?
题目是:从键盘输入几个数,以0作为结束标志,判断其正负,并求其平方和.
void main()
{
int n,m[100],counter=0;
long int sum=0;
while(1)
{
printf("please input a number:");
scanf("%d",&m[n]);
if(m[n]==0)break;
else if(m[n]>0)printf("+\n");
else
printf("-\n");
counter++;
}
for(n=0;n
看一下这个题错在哪?题目是:从键盘输入几个数,以0作为结束标志,判断其正负,并求其平方和.void main(){ int n,m[100],counter=0; long int sum=0; while(1) { printf("please input a number:"); scanf("%d",&m[n]);
//---------------------------------------------------------------------------
#include /*没有包含头文件*/
void main()
{
int n=0,m[100]={0};/*n和m没有初始化,counter无用,去掉*/
long int sum=0;
while(1)
{
printf("please input a number:");
scanf("%d",&m[n]);
if(m[n]==0)break;
else if(m[n]>0)printf("+\n");
else
printf("-\n");
n++;/*n值没有递变*/
}
for(n=0;n