結果
| 問題 | No.671 1000000007 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-28 17:41:34 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 190 bytes |
| 記録 | |
| コンパイル時間 | 146 ms |
| コンパイル使用メモリ | 28,712 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-08 16:18:01 |
| 合計ジャッジ時間 | 624 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:17: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[17]’ [-Wformat=]
9 | scanf("%s", &n);
| ~^ ~~
| | |
| | char (*)[17]
| char *
main.c:10:38: warning: ‘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>: note: built-in ‘abs’ declared here
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s", &n);
| ^~~~~~~~~~~~~~~
ソースコード
#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;
}