將字符串小寫轉(zhuǎn)大寫并延時(shí)輸出的批處理代碼
更新時(shí)間:2010年10月11日 13:28:06 作者:
有一字符串i like the bathome,because here is the batch of the world. 要求用批處理將字符串的所有字母轉(zhuǎn)成大寫并在屏幕上以打字的效果延時(shí)輸出。
出題目的
1 掌握大、小寫互換的技巧
2 掌握延時(shí)輸出技巧
3 掌握字符截取技巧
解題要求
1 確保代碼高效、通用
2 盡量簡(jiǎn)潔代碼
3 不生成臨時(shí)文件
加分規(guī)則
1 思路獨(dú)特基準(zhǔn)分5分
2 代碼高效、通用基準(zhǔn)分4分
3 技巧高超基準(zhǔn)分3分
4 代碼簡(jiǎn)潔基準(zhǔn)分2分
5 完美代碼加分15分
題目如下
有一字符串i like the bathome,because here is the batch of the world.
要求用批處理將字符串的所有字母轉(zhuǎn)成大寫并在屏幕上以打字的效果延時(shí)輸出。
解題限制
暫無(wú)限制
batman:
@echo off
set "str=i like the bathome,because here is the batch of the world."
set "code=A B C D E F G H I J K L N M O P Q R S T U V W X Y Z"
for %%i in (%code%) do call,set "str=%%str:%%i=%%i%%"
:lp
set /p=%str:~,1%<nul&set "str=%str:~1%"
for /l %%i in (1,1,200) do echo>nul
if defined str goto lp
pause>nul
terse:
@echo off&setlocal EnableDelayedExpansion
set "str=i like the bathome,because here is the batch of the world."
for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set str=!str:%%i=%%i!
:lp
set/p=!str:~%n%,1!<nul
set/a n+=1
for /l %%j in (1,1,500) do ver>nul
if not "!str:~%n%,1!"=="" goto lp
pause>nul
1 掌握大、小寫互換的技巧
2 掌握延時(shí)輸出技巧
3 掌握字符截取技巧
解題要求
1 確保代碼高效、通用
2 盡量簡(jiǎn)潔代碼
3 不生成臨時(shí)文件
加分規(guī)則
1 思路獨(dú)特基準(zhǔn)分5分
2 代碼高效、通用基準(zhǔn)分4分
3 技巧高超基準(zhǔn)分3分
4 代碼簡(jiǎn)潔基準(zhǔn)分2分
5 完美代碼加分15分
題目如下
有一字符串i like the bathome,because here is the batch of the world.
要求用批處理將字符串的所有字母轉(zhuǎn)成大寫并在屏幕上以打字的效果延時(shí)輸出。
解題限制
暫無(wú)限制
batman:
復(fù)制代碼 代碼如下:
@echo off
set "str=i like the bathome,because here is the batch of the world."
set "code=A B C D E F G H I J K L N M O P Q R S T U V W X Y Z"
for %%i in (%code%) do call,set "str=%%str:%%i=%%i%%"
:lp
set /p=%str:~,1%<nul&set "str=%str:~1%"
for /l %%i in (1,1,200) do echo>nul
if defined str goto lp
pause>nul
terse:
復(fù)制代碼 代碼如下:
@echo off&setlocal EnableDelayedExpansion
set "str=i like the bathome,because here is the batch of the world."
for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set str=!str:%%i=%%i!
:lp
set/p=!str:~%n%,1!<nul
set/a n+=1
for /l %%j in (1,1,500) do ver>nul
if not "!str:~%n%,1!"=="" goto lp
pause>nul
相關(guān)文章
為用戶批量建立私人文件夾并設(shè)定權(quán)限的批處理
批量建立私人共享文件夾和設(shè)定本地權(quán)限(共享權(quán)限可以設(shè)everyone完全控制,靠本地權(quán)限來(lái)限制)2012-12-12使用批處理for命令清除事件查看器所有Windows EventLog日志
以前裝完系統(tǒng)后要做個(gè)Ghost,為了達(dá)到完美,每次做Ghost前都會(huì)手動(dòng)清除 事件查看器所有Windows EventLog日志2013-05-05關(guān)于制作一個(gè)通用的DOS批處理段注釋命令的思路介紹
關(guān)于制作一個(gè)通用的DOS批處理段注釋命令的思路介紹...2007-03-03