結果
問題 | No.784 「,(カンマ)」 |
ユーザー |
|
提出日時 | 2020-03-21 18:18:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 291 bytes |
コンパイル時間 | 1,989 ms |
コンパイル使用メモリ | 193,524 KB |
最終ジャッジ日時 | 2025-01-09 09:18:41 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ string s; cin>>s; reverse(s.begin(),s.end()); string t; rep(i,s.length()){ t+=s[i]; if(i+1<s.length() && i%3==2) t+=','; } reverse(t.begin(),t.end()); cout<<t<<'\n'; return 0; }