結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
![]() |
提出日時 | 2019-02-08 23:48:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 328 bytes |
コンパイル時間 | 1,573 ms |
コンパイル使用メモリ | 168,716 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 11:46:49 |
合計ジャッジ時間 | 2,145 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 1 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); string t = ""; for (int i = 0; i < s.size(); i++) { t += s[i]; if ((i + 1) % 3 == 0 && i + 1 < s.size()) { t += ","; } } cout << t << endl; return 0; }