早教吧作业答案频道 -->其他-->
程序出错:Thevariable'y'isbeingusedwithoutbeinginitialized.子程序doublexuanzhi2(doublexx,doublex)//getyh{doubley;{if(xx>=0&&xx=0.005&&xx=0.015&&xx=0.025&&xx=0.04&&xx=0.075&&xx=0.15&&xx=0.25&&xx=0.4
题目详情
程序出错:The variable 'y' is being used without being initialized.
子程序 double xuanzhi2(double xx,double x)// get yh { double y; {if(xx>=0 && xx=0.005 && xx=0.015 && xx=0.025 && xx=0.04 && xx=0.075 && xx=0.15 && xx=0.25 && xx=0.4 && xx=0.6 && xx=0.75 && xx
子程序 double xuanzhi2(double xx,double x)// get yh { double y; {if(xx>=0 && xx=0.005 && xx=0.015 && xx=0.025 && xx=0.04 && xx=0.075 && xx=0.15 && xx=0.25 && xx=0.4 && xx=0.6 && xx=0.75 && xx
▼优质解答
答案和解析
你这个程序,我排列了一下,你可以看到,并不是所有的情况,y都会获得一个值,所以不在处理范围内你也需要为y给定一个值,这样就需要对y定义初始值,比如0.0 double xuanzhi2(double xx,double x)//getyh { double y=0.0; if(xx>=0) { if(xx
看了 程序出错:Thevariab...的网友还看了以下: