题解 | #表示数字#
表示数字
https://www.nowcoder.com/practice/637062df51674de8ba464e792d1a0ac6
//https://www.nowcoder.com/practice/637062df51674de8ba464e792d1a0ac6?tpId=37&rp=1&ru=%2Fexam%2Foj%2Fta&qru=%2Fexam%2Foj%2Fta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D1%26pageSize%3D50%26search%3D31%26tpId%3D37%26type%3D37&difficulty=&judgeStatus=&tags=&title=96&gioEnter=menu #include <iostream> using namespace std; int main() { string s; while (cin >> s) { for(int i = 0;i<s.size();i++){ if(isdigit(s[i])){ s.insert(i, "*"); i++; while(isdigit(s[i])) i++; s.insert(i, "*"); } } cout << s << endl; } }