結果

問題 No.581 XOR
ユーザー tsuishitsuishi
提出日時 2021-01-15 11:49:18
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 1,237 ms
コンパイル使用メモリ 27,428 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-16 19:39:22
合計ジャッジ時間 1,563 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘read1’ 内:
main.c:1:21: 警告: 関数 ‘getchar’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    1 | #define mygc(c) (c)=getchar()
      |                     ^~~~~~~
main.c:2:50: 備考: in expansion of macro ‘mygc’
    2 | static void read1(int *x){int k,m=0;*x=0;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){*x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||k>'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);}
      |                                                  ^~~~
main.c:1:1: 備考: ‘getchar’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
  +++ |+#include <stdio.h>
    1 | #define mygc(c) (c)=getchar()
main.c: 関数 ‘main’ 内:
main.c:9:9: 警告: 関数 ‘printf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    9 |         printf("%d\n", a ^ c );
      |         ^~~~~~
main.c:9:9: 備考: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:9:9: 警告: 組み込み関数 ‘printf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
main.c:9:9: 備考: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

#define mygc(c) (c)=getchar()
static void read1(int *x){int k,m=0;*x=0;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){*x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||k>'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);}
static void read2(int *x, int *y){read1(x);read1(y);}

int main(void) {
    int     a,c;

    read2( &a, &c );
	printf("%d\n", a ^ c );
	return 0;
}
0