結果

問題 No.26 シャッフルゲーム
ユーザー Maeda
提出日時 2025-03-07 15:05:35
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 325 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 24,704 KB
実行使用メモリ 8,612 KB
最終ジャッジ日時 2025-03-07 15:05:39
合計ジャッジ時間 2,920 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:33: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
   10 |                 input = scanf("%d %d\n",shuffleList[0],shuffleList[1]);
      |                                ~^       ~~~~~~~~~~~~~~
      |                                 |                  |
      |                                 int *              int
main.c:10:36: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘int’ [-Wformat=]
   10 |                 input = scanf("%d %d\n",shuffleList[0],shuffleList[1]);
      |                                   ~^                   ~~~~~~~~~~~~~~
      |                                    |                              |
      |                                    int *                          int

ソースコード

diff #

#include <stdio.h>

void main(void){
	int target = 0;
	int input = scanf("%d\n",&target);
	int shuffle = 0;
	int shuffleList[2];
	input = scanf("%d\n",&shuffle);
	for(int i = 0 ; i < shuffle ; i++){
		input = scanf("%d %d\n",shuffleList[0],shuffleList[1]);
		if(shuffleList[0] == target){
			target = shuffleList[1];
		}
	}
}
0