結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
|
提出日時 | 2019-03-10 21:15:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 301 bytes |
コンパイル時間 | 1,230 ms |
コンパイル使用メモリ | 159,340 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 15:22:01 |
合計ジャッジ時間 | 1,837 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(void){ int n; string s; cin>>s; n=s.length()%3; for(int i=0;i<s.length();i++){ if(i==0){ cout<<s[i]; continue; } if(i%3==n) cout<<","; cout<<s[i]; } cout<<"\n"; }