結果

問題 No.138 化石のバージョン
ユーザー Maeda
提出日時 2025-03-10 11:37:50
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 287 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 22,784 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-10 11:37:56
合計ジャッジ時間 5,780 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
    4 |         scanf("%d.%d.%d",previousVer[0],previousVer[1],previousVer[2]);
      |                ~^        ~~~~~~~~~~~~~~
      |                 |                   |
      |                 int *               int
main.c:4:20: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘int’ [-Wformat=]
    4 |         scanf("%d.%d.%d",previousVer[0],previousVer[1],previousVer[2]);
      |                   ~^                    ~~~~~~~~~~~~~~
      |                    |                               |
      |                    int *                           int
main.c:4:23: warning: format ‘%d’ expects argument of type ‘int *’, but argument 4 has type ‘int’ [-Wformat=]
    4 |         scanf("%d.%d.%d",previousVer[0],previousVer[1],previousVer[2]);
      |                      ~^                                ~~~~~~~~~~~~~~
      |                       |                                           |
      |                       int *                                       int
main.c:6:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘int’ [-Wformat=]
    6 |         scanf("%d.%d.%d",newVer[0],newVer[1],newVer[2]);
      |                ~^        ~~~~~~~~~
      |                 |              |
      |                 int *          int
main.c:6:20: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘int’ [-Wformat=]
    6 |         scanf("%d.%d.%d",newVer[0],newVer[1],newVer[2]);
      |                   ~^               ~~~~~~~~~
      |                    |                     |
      |                    int *                 int
main.c:6:23: warning: format ‘%d’ expects argument of type ‘int *’, but argument 4 has type ‘int’ [-Wformat=]
    6 |         scanf

ソースコード

diff #

#include <stdio.h>
void main(void){
	int previousVer[3] = {0,0,0};
	scanf("%d.%d.%d",previousVer[0],previousVer[1],previousVer[2]);
	int newVer[3] = {0,0,0};
	scanf("%d.%d.%d",newVer[0],newVer[1],newVer[2]);
	if(previousVer[0] == newVer[0]){
		printf("YES");
	}else{
		printf("NO");
	}
}
0