結果

問題 No.784 「,(カンマ)」
ユーザー shioya
提出日時 2019-02-18 20:21:00
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 1,659 ms
コンパイル使用メモリ 192,800 KB
最終ジャッジ日時 2025-01-06 21:13:50
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main()
{
	string num;
	cin>>num;
	int sub = num.length()%3;
	for(auto i=1;i<=num.length();i++){
		cout<<num[i-1];
		if((i-sub)%3 == 0 && i!=num.length()){
			cout<<',';
		}
	}
	return 0;
}
0