將字符串小寫轉(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 盡量簡潔代碼
3 不生成臨時(shí)文件
加分規(guī)則
1 思路獨(dú)特基準(zhǔn)分5分
2 代碼高效、通用基準(zhǔn)分4分
3 技巧高超基準(zhǔn)分3分
4 代碼簡潔基準(zhǔn)分2分
5 完美代碼加分15分
題目如下
有一字符串i like the bathome,because here is the batch of the world.
要求用批處理將字符串的所有字母轉(zhuǎn)成大寫并在屏幕上以打字的效果延時(shí)輸出。
解題限制
暫無限制
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 盡量簡潔代碼
3 不生成臨時(shí)文件
加分規(guī)則
1 思路獨(dú)特基準(zhǔn)分5分
2 代碼高效、通用基準(zhǔn)分4分
3 技巧高超基準(zhǔn)分3分
4 代碼簡潔基準(zhǔn)分2分
5 完美代碼加分15分
題目如下
有一字符串i like the bathome,because here is the batch of the world.
要求用批處理將字符串的所有字母轉(zhuǎn)成大寫并在屏幕上以打字的效果延時(shí)輸出。
解題限制
暫無限制
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)文章
Windows系統(tǒng)使用bat批量修改文件名的使用示例
bat是非常好用的批處理工具,很多時(shí)候需要批量的修改文件名稱,本文就來介紹一下Windows系統(tǒng)使用bat批量修改文件名的使用示例,具有一定的參考價(jià)值,感興趣的可以了解一下2023-10-10
bat定時(shí)自動(dòng)關(guān)機(jī),bat自動(dòng)結(jié)束任務(wù)關(guān)閉程序,dos自動(dòng)結(jié)束程序后關(guān)機(jī)
bat定時(shí)自動(dòng)關(guān)機(jī),bat自動(dòng)結(jié)束任務(wù)關(guān)閉程序,dos自動(dòng)結(jié)束程序后關(guān)機(jī)的命令介紹2012-12-12
批處理將文件俠內(nèi)的文件名導(dǎo)入表格對(duì)應(yīng)名稱中
這篇文章主要介紹了使用批處理實(shí)現(xiàn)將文件俠內(nèi)的文件名導(dǎo)入表格對(duì)應(yīng)名稱中的方法和兩個(gè)示例,推薦給大家學(xué)習(xí)下。2015-09-09

