例如,如果我的輸出是: -在C++中,我能做些什麼來格式化我的輸出?
King of Spades
Queen of Hearts
Four of Diamonds
Nine of Clubs
Three of Diamonds
Deuce of Spades
Ace of Hearts
然後,我能做些什麼來表現出來,如: -
King of Spades
Queen of Hearts
Four of Diamonds
Nine of Clubs
Three of Diamonds
Deuce of Spades
Ace of Hearts
我只需要對準of's
。有人告訴我setw
可以提供幫助。
是這樣嗎?如果可以的話,那麼如何?
也許你應該查看'setw'的文檔,然後給它一個思考你可以如何使用它來解決問題? –