请问各位大神如何解决这个问题?
如下是我的源程序#define PI 3.14159
void main()
{float r=10.0,l,s,v_s,v;
l=2.0*PI*r;
s=PI*r*r;
v_s=4s;
v=4.0*PI*r*r*r/3.0;
}
编译后出现如下信息:
Compiling...
求球表面积,体积,圆面积,圆周长.cpp
d:\vc++\microsoft visual studio\myprojects\1\2\求球表面积,体积,圆面积,圆周长.cpp(4) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
d:\vc++\microsoft visual studio\myprojects\1\2\求球表面积,体积,圆面积,圆周长.cpp(5) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
d:\vc++\microsoft visual studio\myprojects\1\2\求球表面积,体积,圆面积,圆周长.cpp(6) : error C2059: syntax error : 'bad suffix on number'
d:\vc++\microsoft visual studio\myprojects\1\2\求球表面积,体积,圆面积,圆周长.cpp(6) : error C2146: syntax error : missing ';' before identifier 's'
d:\vc++\microsoft visual studio\myprojects\1\2\求球表面积,体积,圆面积,圆周长.cpp(7) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
执行 cl.exe 时出错.
求球表面积,体积,圆面积,圆周长.obj - 1 error(s), 0 warning(s)