結果

問題 No.784 「,(カンマ)」
ユーザー michonz4
提出日時 2019-12-04 16:36:41
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 21:43:40
合計ジャッジ時間 849 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int main() {
  char s[16];
  scanf("%s", s);
  size_t size = strlen(s);

  for (int i=0; i<size; i++) {
    if ((size-i)%3==0 && i!=0) {
      printf(",");
    }
    printf("%c", s[i]);
  }
  printf("\n");
  return 0;
}
0