結果

問題 No.784 「,(カンマ)」
ユーザー 37zigen37zigen
提出日時 2019-08-12 18:46:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 65,548 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-17 06:21:06
合計ジャッジ時間 1,169 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

int main() {
  std::string N;
  std::cin >> N;
  for (int i  = 0; i < N.size(); ++i) {
    std::cout << N[i];
    int res = N.size() - (i + 1);
    if (res != 0 && res != N.size() && res % 3 == 0){
      std::cout << ",";
    }
  }
  std::cout << std::endl;
  return 0;
}
0