結果

問題 No.671 1000000007
ユーザー N/AN/A
提出日時 2018-08-28 17:41:34
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 1,550 ms
コンパイル使用メモリ 27,016 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-23 03:38:29
合計ジャッジ時間 1,186 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 0 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 0 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:10:24: 警告: 関数 ‘abs’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   10 |         printf("%d\n", abs(strlen(n) - 10));
      |                        ^~~
main.c:5:1: 備考: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
    4 | #include <math.h>
  +++ |+#include <stdlib.h>
    5 | 
main.c:10:38: 警告: ‘abs’ argument 1 promotes to ‘size_t’ {aka ‘long unsigned int’} where ‘int’ is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   10 |         printf("%d\n", abs(strlen(n) - 10));
      |                            ~~~~~~~~~~^~~~
<組み込み>: 備考: built-in ‘abs’ declared here

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <math.h>

int main(void) {
	char n[17];

	scanf("%s", &n);
	printf("%d\n", abs(strlen(n) - 10));

	return 0;
}
0