活動(dòng)地址: 牛客春招刷題訓(xùn)練營(yíng) - 編程打卡活動(dòng) 簡(jiǎn)單題 字符串分隔 記 為字符串的長(zhǎng)度。 當(dāng) 不為 的倍數(shù)時(shí)在字符串后面補(bǔ) 。 利用 substr() 對(duì)字符串切片輸出。 字符串的 substr(i, n) 成員函數(shù)會(huì)返回 中下標(biāo)為 的子串。 #include <iostream> using namespace std; int main() { string s; cin >> s; while (s.length() % 8 != 0) s += "0"; for (int i = ...