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