Submission #15398

#TimeUsernameProblemLanguageResultExecution timeMemory
15398cki86201님 무기가 좀 나쁘시네여 (kriii3_S)C++98
Compilation error
0 ms0 KiB
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<algorithm> using namespace std; double p[4][5]; double Get(double a, double b, double c, double d, double e){ return a * (1 + b / 100.0) * ((1 - min(c, 1.0)) + min(c, 1.0) * d) * (1 + e); } void print(double x, double y){ if (fabs(x - y) < 1e-10)printf("0\n"); else if (x < y)printf("+\n"); else printf("-\n"); } int main(){ for (int i = 0; i < 4; i++){ for (int j = 0; j < 5; j++)scanf("%lf", p[i] + j); p[i][2] /= 100; p[i][3] /= 100; p[i][4] /= 100; } double q[5]; for (int i = 0; i < 5; i++)q[i] = p[2][i] - p[3][i]; double K1 = Get(p[0][0], p[0][1], p[0][2], p[0][3], p[0][4]); double K2 = Get(p[0][0] - q[0], p[0][1] - q[1], p[0][2] - q[2], p[0][3] - q[3], p[0][4] - q[4]); double K3 = Get(p[1][0], p[1][1], p[1][2], p[1][3], p[1][4]); double K4 = Get(p[1][0] + q[0], p[1][1] + q[1], p[1][2] + q[2], p[1][3] + q[3], p[1][4] + q[4]); print(K1, K2); print(K3, K4); return 0; }

Compilation message (stderr)

relay.cpp: In function ‘void print(double, double)’:
relay.cpp:12:16: error: ‘fabs’ was not declared in this scope
  if (fabs(x - y) < 1e-10)printf("0\n");
                ^
relay.cpp: In function ‘int main()’:
relay.cpp:19:52: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   for (int j = 0; j < 5; j++)scanf("%lf", p[i] + j);
                                                    ^