批处理中,如何处理小数的加和
淡定如水 2011-12-03 11:46:29 @echo off
color 06
goto start
:start
set /p select1=请输入您的性别(男/女):
if %select1%==男 (echo 您的性别为%select1%)else (echo 您输入的不是男或女,请重新输入&goto start)
echo ***************************
goto high
:high
set /p select2=请输入您的身高(cm):
echo "%select2%"|findstr "^.[0-9][0-9]*.$">nul&&echo 您的身高为%select2%cm||(echo 请不要输入字母或小数,请重新输入&goto high)
echo ***************************
goto weight
:weight
set /p select3=请输入您的体重(kg):
rem echo "%select3%"|findstr "^.[0-9][0-9]*.$">nul&&echo 您的体重为%select3%kg||(echo 请不要输入字母或小数,请重新输入&goto weight)
echo "%select3%"|findstr "[a-zA-Z]">nul&&(echo 输入的不是正数,请重新输入&goto weight)||echo 您的体重为%select3%kg
echo ***************************
set /a aa=%select2%+%select3%
color 0c
echo 您的肺活量为***%aa%毫升***
echo ***************************
pause&exit
在计算结果中,总是会省略掉小数点;
如:2+3.5,结果就是5而不是5.5
怎么解决?