float sn=100.0,hn=50.0;
for(int n=2;n<=10;n++)
{
sn=sn+2*hn;/*第n次落地时共经过的米数*/
hn=hn/2; /*第n次反跳高度*/
}
printf("第10次落地时,共经过%f米 \n",sn);
printf("第10次反弹%f米\n",hn);
-----错误提示如下-----
Compiling...
text_one.cpp
G:\text_one.cpp(9) : error C2018: unknown character '0xa1'
G:\text_one.cpp(9) : error C2018: unknown character '0xa1'
G:\text_one.cpp(10) : error C2018: unknown character '0xa1'
G:\text_one.cpp(10) : error C2018: unknown character '0xa1'
G:\text_one.cpp(10) : error C2018: unknown character '0xa1'
G:\text_one.cpp(10) : error C2018: unknown character '0xa1'
G:\text_one.cpp(11) : error C2018: unknown character '0xa1'
G:\text_one.cpp(11) : error C2018: unknown character '0xa1'
G:\text_one.cpp(11) : error C2018: unknown character '0xa1'
G:\text_one.cpp(11) : error C2018: unknown character '0xa1'
G:\text_one.cpp(12) : error C2018: unknown character '0xa1'
G:\text_one.cpp(12) : error C2018: unknown character '0xa1'
G:\text_one.cpp(15) : warning C4508: 'main' : function should return a value; 'void' return type assumed
G:\text_one.cpp(41) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
G:\text_one.cpp(41) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(42) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(43) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(44) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(49) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(51) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(53) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(55) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(57) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(59) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
G:\text_one.cpp(70) : warning C4244: '=' : conversion from 'double' to 'long', possible loss of data
G:\text_one.cpp(71) : warning C4244: '=' : conversion from 'double' to 'long', possible loss of data
G:\text_one.cpp(157) : warning C4305: 'initializing' : truncation from 'const int' to 'char'
G:\text_one.cpp(157) : warning C4309: 'initializing' : truncation of constant value
G:\text_one.cpp(157) : warning C4305: 'initializing' : truncation from 'const int' to 'char'
G:\text_one.cpp(157) : warning C4309: 'initializing' : truncation of constant value
执行 cl.exe 时出错.
text_one.obj - 1 error(s), 0 warning(s)