結果
| 問題 | 
                            No.410 出会い
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nninjinn00
                         | 
                    
| 提出日時 | 2016-11-12 22:30:52 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 205 bytes | 
| コンパイル時間 | 129 ms | 
| コンパイル使用メモリ | 21,376 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-25 21:39:14 | 
| 合計ジャッジ時間 | 805 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 4 | 
| other | WA * 19 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:17: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double *’ [-Wformat=]
    5 |         scanf("%f%f%f%f", &px, &py, &qx, &qy);
      |                ~^         ~~~
      |                 |         |
      |                 float *   double *
      |                %lf
main.c:5:19: warning: format ‘%f’ expects argument of type ‘float *’, but argument 3 has type ‘double *’ [-Wformat=]
    5 |         scanf("%f%f%f%f", &px, &py, &qx, &qy);
      |                  ~^            ~~~
      |                   |            |
      |                   float *      double *
      |                  %lf
main.c:5:21: warning: format ‘%f’ expects argument of type ‘float *’, but argument 4 has type ‘double *’ [-Wformat=]
    5 |         scanf("%f%f%f%f", &px, &py, &qx, &qy);
      |                    ~^               ~~~
      |                     |               |
      |                     float *         double *
      |                    %lf
main.c:5:23: warning: format ‘%f’ expects argument of type ‘float *’, but argument 5 has type ‘double *’ [-Wformat=]
    5 |         scanf("%f%f%f%f", &px, &py, &qx, &qy);
      |                      ~^                  ~~~
      |                       |                  |
      |                       float *            double *
      |                      %lf
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%f%f%f%f", &px, &py, &qx, &qy);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(void){
	double a, px, py, qx, qy;
	scanf("%f%f%f%f", &px, &py, &qx, &qy);
	a = ((px-qx+px-py)/2);
	if(a>0)
		printf("%f\n", a);
	else
		printf("%f\n", a *= -1);
	return 0;
}
            
            
            
        
            
nninjinn00