結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
|
提出日時 | 2019-06-29 16:06:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 316 bytes |
コンパイル時間 | 582 ms |
コンパイル使用メモリ | 72,140 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 05:35:03 |
合計ジャッジ時間 | 3,553 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 10 |
ソースコード
#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; }