結果

問題 No.163 cAPSlOCK
ユーザー hsmbhsmb
提出日時 2017-05-11 22:51:29
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 360 bytes
コンパイル時間 1,095 ms
コンパイル使用メモリ 28,196 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 11:07:07
合計ジャッジ時間 2,168 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 0 ms
4,352 KB
testcase_04 AC 0 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 0 ms
4,348 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 0 ms
4,348 KB
testcase_11 AC 0 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 0 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 0 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 0 ms
4,348 KB
testcase_19 AC 0 ms
4,348 KB
testcase_20 AC 0 ms
4,348 KB
testcase_21 AC 0 ms
4,352 KB
testcase_22 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:9:9: 警告: 関数 ‘memset’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    9 |         memset(str, 0, sizeof(str));
      |         ^~~~~~
main.c:3:1: 備考: include ‘<string.h>’ or provide a declaration of ‘memset’
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:9:9: 警告: 組み込み関数 ‘memset’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
    9 |         memset(str, 0, sizeof(str));
      |         ^~~~~~
main.c:9:9: 備考: include ‘<string.h>’ or provide a declaration of ‘memset’

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

int main(void){
	int i;
	unsigned char str[101];
	unsigned char sub;

	memset(str, 0, sizeof(str));
	scanf("%s", str);

	sub = 'a' -'A';
	for(i=0; str[i] != '\0' && i < 100; i++){
		if(str[i] >= 'a')
			str[i] = str[i] - sub;
		else
			str[i] = str[i] + sub;
	}

	printf("%s\n", str);

	return 0;
}
0