結果

問題 No.784 「,(カンマ)」
ユーザー eyeSharp
提出日時 2019-10-16 20:48:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 1,580 ms
コンパイル使用メモリ 160,060 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 03:03:18
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
    No.784 「,(カンマ)」
    https://yukicoder.me/problems/no/784
*/
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    string n;
    cin >> n;

    for (size_t i = 0; i < n.size(); i++) {
        cout << n[i];
        if (((n.size() - i - 1) % 3 == 0) && (i - n.size() + 1) != 0) {
            cout << ",";
        }
    }
    cout << endl;
}
0