結果

問題 No.5 数字のブロック
ユーザー Maeda
提出日時 2025-03-07 11:28:10
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 533 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 23,936 KB
実行使用メモリ 8,612 KB
最終ジャッジ日時 2025-03-07 11:28:17
合計ジャッジ時間 5,988 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:29: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
    7 |         int input = scanf("%d\n%d\n",l,n);
      |                            ~^        ~
      |                             |        |
      |                             int *    int
main.c:7:33: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘int’ [-Wformat=]
    7 |         int input = scanf("%d\n%d\n",l,n);
      |                                ~^      ~
      |                                 |      |
      |                                 int *  int
main.c:16:41: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
   16 |                 int inputList = scanf("%d\n",sizeList[i]);
      |                                        ~^    ~~~~~~~~~~~
      |                                         |            |
      |                                         int *        int

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

void main(){
	//大きな箱のサイズと箱の数
	int l = 0 , n = 0 ;
	int input = scanf("%d\n%d\n",l,n);
	if(input == 2){
		printf("入力ミス\n");
	}

	int sizeList[n];
	//小さい箱のサイズ一覧
	//int *sizeList = (int *)calloc(n,sizeof(int));
	for(int i = 0 ; i  < n; i ++ ){
		int inputList = scanf("%d\n",sizeList[i]);
		if(inputList == 2){
			printf("入力ミス\n");
		}
	}
	
	for(int i = 0 ; i< n ; i++ ){
		if(sizeList!= NULL){
			printf("%d\n",sizeList[i]);
		}
	}

}
0