結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
|
提出日時 | 2019-07-29 15:33:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 474 bytes |
コンパイル時間 | 650 ms |
コンパイル使用メモリ | 71,680 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 15:21:55 |
合計ジャッジ時間 | 1,209 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 8 |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(void){ // Your code here! string N; cin >> N; sort(N.rbegin(),N.rend()); string S = ""; for(int i = 0; i < N.size(); i++){ S.push_back(N[i]); if(i%3 == 2 and i != N.size() - 1){ S.push_back(','); } } for(auto itr = S.rbegin(); itr != S.rend(); itr++){ cout << *itr; } cout << endl; }