結果

問題 No.423 ハムスター語初級(数詞)
ユーザー bal4ubal4u
提出日時 2019-04-17 19:27:53
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 28,476 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 07:31:31
合計ジャッジ時間 744 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'ins':
main.c:8:14: warning: implicit declaration of function 'getchar_unlocked' [-Wimplicit-function-declaration]
    8 | #define gc() getchar_unlocked()
      |              ^~~~~~~~~~~~~~~~
main.c:17:17: note: in expansion of macro 'gc'
   17 |         do *s = gc();
      |                 ^~
main.c: In function 'outs':
main.c:9:15: warning: implicit declaration of function 'putchar_unlocked' [-Wimplicit-function-declaration]
    9 | #define pc(c) putchar_unlocked(c)
      |               ^~~~~~~~~~~~~~~~
main.c:23:33: note: in expansion of macro 'pc'
   23 | void outs(char *s) { while (*s) pc(*s++); }
      |                                 ^~

ソースコード

diff #

// yukicoder: No.423 ハムスター語初級(数詞)
// 2019.4.17 bal4u

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

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int ins(char *s)  // 文字列の入力 スペース以下の文字で入力終了
{
	char *p = s;
	do *s = gc();
	while (*s++ > ' ');
	*--s = 0;
	return s - p;
}

void outs(char *s) { while (*s) pc(*s++); }

char n[60];

int main()
{
	int w = ins(n);
	if (w > 3) strcpy(n+ins(n), "ham");
	outs(n), pc('\n');
	return 0;
}
0