結果
| 問題 |
No.784 「,(カンマ)」
|
| コンテスト | |
| ユーザー |
leaf+
|
| 提出日時 | 2019-04-13 19:17:10 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 310 bytes |
| コンパイル時間 | 468 ms |
| コンパイル使用メモリ | 56,796 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 11:18:11 |
| 合計ジャッジ時間 | 1,135 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 1 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main() {
string ans;
int i;
long n;
cin >> n;
for (i = 0; n > 0; i++) {
if (i != 0 && i % 3 == 0) {ans = "," + ans;}
ans = to_string(n % 10) + ans;
n /= 10;
}
cout << ans << endl;
return 0;
}
leaf+