×
解除綁定,重新設定系統帳號的密碼
您的系統帳號 ID:
您的系統帳號:
您的帳號暱稱:
設定新密碼:
設定新密碼:
×
請輸入要加入的「課程代碼」
請向開設課程的使用者索取「課程代碼」
分類題庫
解題動態
排行榜
討論區
競賽區
登入
註冊
發表新討論
#54267: 補程式碼
hch980506@gmail.com
(申有娜我老婆)
學校:
國立臺南高級工業職業學校
編號:
294649
×
傳送站內訊息
傳給:
主題:
內容:
來源:
[36.236.252.39]
註冊時間:
2024-11-28 01:12:33
最後登入時間:
2025-12-10 14:34:08
d422.
2.字串處理
--
ACM
| From: [114.27.28.105] | 發表日期: 2025-12-25 14:37
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main() {
string input;
while (cin >> input) {
int times = 0;
for (char c : input) {
if (isdigit(c)) {
times += c - '0';
} else if (c == 'b') {
while (times--) {
cout << ' ';
}
times = 0;
} else if (c == '!') {
cout << '\n';
} else {
while (times--) {
cout << c;
}
times = 0;
}
}
cout << '\n';
}
}