結果
問題 |
No.784 「,(カンマ)」
|
ユーザー |
![]() |
提出日時 | 2019-12-04 15:57:41 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 375 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 15:48:22 |
合計ジャッジ時間 | 743 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 10 |
ソースコード
#include <stdio.h> #include <string.h> int main() { char s[16], buf[16]; scanf("%s", s); size_t 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; }