結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  sasa | 
| 提出日時 | 2025-03-03 10:48:49 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 386 bytes | 
| コンパイル時間 | 188 ms | 
| コンパイル使用メモリ | 26,240 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2025-03-03 10:49:37 | 
| 合計ジャッジ時間 | 727 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 10 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:33: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int *’ [-Wformat=]
   15 |                         scanf("%s",&p[i]);
      |                                ~^  ~~~~~
      |                                 |  |
      |                                 |  int *
      |                                 char *
      |                                %ls
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&val);
      |         ^~~~~~~~~~~~~~~~
main.c:15:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |                         scanf("%s",&p[i]);
      |                         ^~~~~~~~~~~~~~~~~
main.c:20:13: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |             scanf("%s", str);
      |             ^~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
	int val = 0;
	scanf("%d",&val);
	printf("%d\n",val);
	
	int i = 0;
	while(i != val){
		int num[4];
		int *p = num;
		for(int i = 0;i < 4;i++){
			scanf("%s",&p[i]);
			printf("%d ",p[i]);
		}
		printf("\n");
	    char *str = malloc(101);
	    scanf("%s", str);
	    printf("%s", str);
	    
	    
		i++;
	}
}
            
            
            
        