結果

問題 No.1415 100の倍数かつ正整数(1)
コンテスト
ユーザー tsuishi
提出日時 2021-04-15 13:17:30
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 235 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 134 ms
コンパイル使用メモリ 29,124 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-03-08 16:26:15
合計ジャッジ時間 979 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    5 |     scanf("%s",s);
      |     ^~~~~
main.c:2:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
    1 | #include <string.h>
  +++ |+#include <stdio.h>
    2 | main(){
main.c:8:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    8 |         printf("0\n");
      |         ^~~~~~
main.c:8:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:11:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
   11 |         printf("%s\n",s);
      |         ^~~~~~
main.c:11:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #
raw source code

#include <string.h>
main(){
    char    s[128];
    int     len;
    scanf("%s",s);
    len = strlen(s);
    if( s[0] == '-' || len < 3 ) {
        printf("0\n");
    } else {
        s[len-2] = '\0';
        printf("%s\n",s);
    }
}
0