結果
| 問題 |
No.784 「,(カンマ)」
|
| コンテスト | |
| ユーザー |
michonz4
|
| 提出日時 | 2019-12-04 15:58:07 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 372 bytes |
| コンパイル時間 | 987 ms |
| コンパイル使用メモリ | 29,056 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-30 15:48:28 |
| 合計ジャッジ時間 | 607 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 10 |
ソースコード
#include <stdio.h>
#include <string.h>
int main() {
char s[16], buf[16];
scanf("%s", s);
int size = strlen(s)-1;
int j=0;
for (int i=size; i>=0; i--, j++) {
if ((j+1)%4==0 && i!=size) {
buf[j++]=',';
buf[j]=s[i];
} else {
buf[j]=s[i];
}
}
for (int i=j; i>=0; i--) {
printf("%c", buf[i]);
}
printf("\n");
return 0;
}
michonz4