- @echo off
- set xm=7&set dm=7&set std=14&set nh=7&set sum=0
- for /l %%a in (1,1,%nh%) do (
- for /l %%b in (1,1,%std%) do (
- for /l %%c in (1,1,%dm%) do (
- for /l %%d in (1,1,%xm%) do (
- call set /a sum=%%sum%%+4
- )
- call set /a sum=%%sum%%+4
- )
- )
- call set /a sum=%%sum%%+2
- )
- set /a sum1=%sum%+2
- echo 公車上加上司機一共有%sum1%條腿,不加司機有%sum%條腿!~_~
- pause>nul 2>nul
复制代码
不知道這樣用FOR可不可以! |