結果

問題 No.423 ハムスター語初級(数詞)
ユーザー sk3388607083
提出日時 2019-01-24 22:14:09
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 04:44:09
合計ジャッジ時間 571 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(void)
{
  int i;
  char n[100];

  scanf("%s", n);

  if(strcmp(n, "ham")) {
    for (i = 0; n[i] != '\0'; i++);
    n[i] = 'h';
    n[i + 1] = 'a';
    n[i + 2] = 'm';
    n[i + 3] = '\0';
  }
  printf("%s\n", n);

  return 0;
}
0