結果

問題 No.784 「,(カンマ)」
ユーザー toto6114
提出日時 2019-06-29 16:11:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 72,744 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-02 05:35:19
合計ジャッジ時間 1,217 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 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==4) {
          t+=',';
          cnt=1;
      }
      t+=s[i];
  }
  reverse(t.begin(),t.end());
  cout << t << endl;
}
0