結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
|
提出日時 | 2019-06-29 16:08:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 316 bytes |
コンパイル時間 | 647 ms |
コンパイル使用メモリ | 72,180 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-02 05:35:17 |
合計ジャッジ時間 | 1,219 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 2 WA * 8 |
ソースコード
#include<iostream> #include<algorithm> #include<cmath> using namespace std; int main() { int cnt=0; string s,t=""; cin >> s; for(int i=s.size()-1; i>=0; i--) { cnt++; if(cnt==3) { t+=','; cnt=0; } t+=s[i]; } reverse(t.begin(),t.end()); cout << t << endl; }