結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
![]() |
提出日時 | 2020-03-05 16:05:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 277 bytes |
コンパイル時間 | 1,601 ms |
コンパイル使用メモリ | 166,152 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 01:18:41 |
合計ジャッジ時間 | 2,237 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> #define INF 990000000 //19 using namespace std; int main() { string n; cin>>n; int am=(int)n.size()%3; //cout << am<<endl; for(int i=0;i<(int)n.size();i++){ if(i==am && i!=0){ cout << ","; am+=3; } if(i==0 && am==0)am+=3; cout << n[i]; } }