我有可能的輸入1M 2M .. 11M和1Y(M和Y代表幾個月),我想輸出「somestring1 somestring2 ....和somestring12」註釋M和Y被刪除,最後一個字符串更改爲12如何從字符串中刪除字符並在需要時更改數據?
Example: input "11M" "hello" output: hello11
input "1Y" "hello" output: hello1
char * (const char * date, const char * somestr)
{
// just need to output final string no need to change the original string
cout<< finalStr<<endl;
}
呃,什麼問題? –
問題不太清楚.. 你能再多解釋嗎 –
舉一個輸入和期望輸出的例子。 – Dialecticus