TA貢獻1846條經驗 獲得超7個贊
#include <algorithm>#include <string>std::string str = "Hello World";std::transform(str.begin(), str.end(),str.begin(), ::toupper);
TA貢獻1806條經驗 獲得超8個贊
使用C+11和Touper()的簡短解決方案。
for (auto & c: str) c = toupper(c);
舉報
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號