c语言一般在哪里写作业,我在写编程作业,出了个错误,不懂,求教

公告: 为响应国家净网行动,部分内容已经删除,感谢读者理解。

话题:我在写编程作业,出了个错误,不懂,求教回答:很大情况是你在中文输入法状态下输入的空格,为了,将他该改成32吧,32空格的ascii码,问题解决了记得设为满意啊,答题不容易啊,谢谢:-P

参考回答:可以用空格的ASCII码值来判断.ASCII中空格的值为32,所以判断空格的语句可以这样写:else if (str[i] == 32) { do something}话题:求助,C++编程不知道哪里出了问题,大家帮忙看一下吧回答:#include void main(){ int a[10]; int i,max=0; printf("please enter numbers:\0");for (i=0;i10;i++) scanf("%d话题:c语言编程哪里出了问题了???回答:123456123456Press any key to continue 我来个权威解答吧 第一 a 和b可以用unsigned char的 理论上unsigned char 也是int 只不过范围是 0 -255的int数值 第二 第二个for里的a+=1

参考回答:以后码不要贴图片首先 a+=1; 和 *(owari + a) = kass[b]; 位置对调其次 在第二个for后面加 *(owari + a) = '\0'; 字符串结束符话题:这是个很简单的编程,不知道那里出了问题啊,新手话题回答:printf("This is a c program.\n")应改为printf("This is a c program.\n");你少了一个分号,C语言每条语句结束都应该以分号结束。话题:编程题调试出问题了,旦不知道怎么解决,高手帮忙回答:们,你这个程序太乱了,帮你改了一下,也看不清你是做什么,结果对不对就不知道了。反正通过了。#includechar o[]={'A','B','C','D','E','F','G','H'}; float p[]={100,50,25,10,5,2.5,1,0.5}; void d(double,double,float); void main() { int i,h; double j,w; float s[3],t[3]; float q;bool b=false; while (1) { printf("请输入所需求的比例尺:1:");scanf("%f",amp;q);for (int k=0;klt;;k++)if (p[k]==q)b=true;if (b)break;}printf("请输入分别经度和纬度,度分均用空格替:\r\n");scanf("%f %f %f",amp;s[0],amp;s[1],amp;s[2]);scanf("%f %f %f",amp;t[0],amp;t[1],amp;t[2]);j=s[0]+s[1]/60.0+s[2]/3600.0; w=t[0]+t[1]/60.0+t[2]/3600.0; d(j,w,q); } void d(double j,double w,float q) { int i;double a,b;double jc[]={6.0,3.0,1.5,0.5,0.25,0.125,0.0625,0.03125}, wc[]={4.0,2.0,1.0,1.0/3,1.0/6,1.0/12,1.0/24,1.0/4}; double c,d,m,n; a=j/jc[0]+1; if(jgt;=0amp;amp;jlt;=10) b=j/6+31; else b=31-j/6; printf("该经纬度所在的图幅编号为:"); printf("%d%d",(int)a,(int)b); for(i=0;ilt;;i++) if(q==p[i]) break;m=w/(wc[i]*4.0); c=4.0/wc[i]-m; n=j/(jc[i]*6.0); d=n+1; if(i!=0) {printf("%c",q); if(clt;=) {printf("00"); printf("%d",c);} else if(cgt;amp;amp;clt;=) { printf("0"); printf("%d",c); } else printf("%d",c); if(dlt;=) {printf("00"); printf("%d",d);} else if(dgt;amp;amp;dlt;=) { printf("0"); printf("%d",d); } else printf("%d",d); } }

参考回答:好长,这么多错误,你自己先再说吧。--------------------Configuration: Cpp1 - Win32 Debug--------------------pilingCpp1.cppE:\Cpp1.cpp(23) : warning C450: 'main' : function should return a value; 'void' return type assumedE:\Cpp1.cpp(3) : error C210: sub is not of integral typeE:\Cpp1.cpp(3) : error C2446: '==' : no conversion from 'float *' to 'float' There is no context in which this conversion is possibleE:\Cpp1.cpp(3) : error C2115: '==' : inpatible typesE:\Cpp1.cpp(3) : error C2014: preprocessor mand must start as first nonwhite spaceE:\Cpp1.cpp(43) : error C2144: syntax error : missing ')' before type 'double'E:\Cpp1.cpp(43) : error C2064: term does not evaluate to a functionE:\Cpp1.cpp(43) : error C205: syntax error : ')'E:\Cpp1.cpp(45) : error C2143: syntax error : missing ';' before '{'E:\Cpp1.cpp(60) : error C2064: term does not evaluate to a functionE:\Cpp1.cpp(63) : error C2144: syntax error : missing ')' before type 'double'E:\Cpp1.cpp(63) : error C2064: term does not evaluate to a functionE:\Cpp1.cpp(63) : error C205: syntax error : ')'E:\Cpp1.cpp(64) : error C2143: syntax error : missing ';' before '{'E:\Cpp1.cpp() : error C210: sub is not of integral typeE:\Cpp1.cpp() : error C2446: '==' : no conversion from 'float *' to 'float' There is no context in which this conversion is possibleE:\Cpp1.cpp() : error C2115: '==' : inpatible typesE:\Cpp1.cpp(0) : error C210: sub is not of integral typeE:\Cpp1.cpp(0) : error C226: '*' : illegal, left operand has type 'double *'E:\Cpp1.cpp(1) : error C210: sub is not of integral typeE:\Cpp1.cpp(1) : error C22: '/' : illegal, right operand has type 'double *'E:\Cpp1.cpp(2) : error C210: sub is not of integral typeE:\Cpp1.cpp(2) : error C226: '*' : illegal, left operand has type 'double *'E:\Cpp1.cpp(110) : error C210: sub is not of integral typeE:\Cpp1.cpp(110) : error C226: '*' : illegal, left operand has type 'double *'E:\Cpp1.cpp(111) : error C210: sub is not of integral typeE:\Cpp1.cpp(111) : error C22: '/' : illegal, right operand has type 'double *'E:\Cpp1.cpp(112) : error C210: sub is not of integral typeE:\Cpp1.cpp(112) : error C226: '*' : illegal, left operand has type 'double *'E:\Cpp1.cpp() : warning C450: 'd' : function should return a value; 'void' return type assumedError executing cl.exe.Cpp1.exe - 2 error(s), 2 warning(s)话题:怎么解决编程中遇到不懂的问题回答:这个只有自己买些参考书看看啊 看不懂最好能请教身边懂的人 这样更容易懂的多

参考回答:看教程,然后照着做,关键是要听懂他讲的什么话题:C++编程出了点问题,不知道错在哪,请高手看下回答:leader[k],"leader[k];i=10;i++) { cinleader_name; for(j=1.不是用_ leader[j].counter++; } for(k=0; /k3;k++) cout加分号 int main() { int i,j,k; person leader[3]={quot,0}; char leader_name[20]; for(i=1;j=3; j++) if(strcmp(leader_name,leader[j].name)==0) /li"leader拼写错误 return 0;lt.namelt这是一个候选人得的统计程序 里面错误- -|| 修改了下,好了;,0,"wang"; struct person { char name[20]; int counter;zhang";/要用; }; ,错误都注释在程序中了 #include /iostreamgt.counterendl,0;/这些头包含,命名空间要放在程序最开头 using namespace std

参考回答:leader[j]_name)函数是,在前面要加头#includelt;stringstruct person { char name[20]; int counter;)使用strcmp(leader_name; } 后加个分号(话题:我不知道是我的程序出了问题,还是我编程出了问题;我写的这个程回答:#include int main(){ int c, g; scanf("%d",g); if(g=0 g c=g/10; else printf("error\n"); switch(c){ case 6:printf("D\n");break; case :printf("C\n");break; case :printf("B\n");break; case :printf("A\n");break; case 10:printf("A\n");break; } return 0;}你写的程序没有语法错误。可以运行。你指的无法编译的情况可能是你不会作IDE吧。上面的*是因为你修改了,没有保存的缘故。但是if里面的判断会有问题的。另外c/c++的后缀名必须是.c,或者.cpp

参考回答:#include int main(){int c, g;scanf("%d",g);if(ggt;=0 g c=g/10;elseprintf("error\n");switch(c){case 6:printf("D\n");break;case :printf("C\n");break;case :printf("B\n");break;case :printf("A\n");break;case 10:printf("A\n");break;}return 0;}你写的程序没有语法错误。可以运行。你指的无法编译的情况可能是你不会作IDE吧。上面的*是因为你修改了,没有保存的缘故。但是if里面的判断会有问题的。另外c/c++的后缀名必须是.c,或者.cpp话题:C语言程序求教,不懂哪里出了问题。程序和错误如下回答:你这个真是有意思,入口函数main()没有安,包含也没有,函数也没有自己定义,怎么调用,你开什么玩笑话题:有段C语言编程看不懂,大家帮帮忙,谁能解释下怎么运行的回答:码本身就是错误的。看不懂是最正常的,看懂了就出问题了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值