結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー chocoruskchocorusk
提出日時 2019-04-01 05:23:23
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 27,776 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 07:47:13
合計ジャッジ時間 997 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:4:12: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |     int n; scanf("%d", &n);
      |            ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main()
main.c:4:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |     int n; scanf("%d", &n);
      |            ^~~~~
main.c:4:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:13: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |             printf("=\n");
      |             ^~~~~~
main.c:10:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:9: warning: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
   14 |         sprintf(s, "%d", d);
      |         ^~~~~~~
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:14:9: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch]
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:15:23: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   15 |         if(s[0]=='-') printf("%c\n", c1);
      |                       ^~~~~~
main.c:15:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:14: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 |         else printf("%c\n", c2);
      |              ^~~~~~
main.c:16:14: note: include '<stdio.h>' or provide a declaration of 'printf'

ソースコード

diff #

int main()
{
    char c1='0'+12, c2='0'+14;
    int n; scanf("%d", &n);
    while(n){
        n--;
        int a, b; scanf("%d %d", &a, &b);
        int d=a-b;
        if(d==0){
            printf("=\n");
            continue;
        }
        char s[100]={'\0'};
        sprintf(s, "%d", d);
        if(s[0]=='-') printf("%c\n", c1);
        else printf("%c\n", c2);
    }
    return 0;
}
0