結果

問題 No.784 「,(カンマ)」
ユーザー toto6114
提出日時 2019-06-29 16:07:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 316 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 72,132 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-02 05:35:15
合計ジャッジ時間 3,704 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0