結果
問題 | No.784 「,(カンマ)」 |
ユーザー |
![]() |
提出日時 | 2019-02-08 21:26:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 662 ms |
コンパイル使用メモリ | 82,520 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 18:20:55 |
合計ジャッジ時間 | 1,250 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 5 WA * 5 |
ソースコード
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <iostream> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <numeric> #include <cassert> #include <memory> #include <stack> #include <set> #include <map> #define INF 1000000000 #define MOD 1000000007 typedef long long ll; typedef unsigned long long ull; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string n; cin>>n; string s; for(int i = n.size() - 1; i >= 0; i--) { s += n[i]; if (i % 3 == 0 && i != 0) { s += ','; } } reverse(s.begin(),s.end()); cout << s << endl; }