|
|
вернуться в форумОбщий форумPlease, explain me, why I have CE with this code? (C++) I tried to get results by e-mail but no letter was sent to mine... So I cannot understand why I have CE? I'll be very pleased for any help, because I have not idea at all... #include <stdlib.h> #include <stdio.h> #include <iostream.h> #include <math.h> long V, a; double K, arad; void Load(){ freopen("input.txt", "r", stdin); cin >> V >> a >>K; arad = a * M_PI / 180; fclose(stdin); } void Solve(){ double S = 0, l, t; double SqrtK = sqrt(K); double Vx = V * cos(arad), Vy = V * sin(arad), g = 10; freopen("output.txt", "w", stdout); while (true){ t = 2 * Vy / g; l = Vx * t; S += l; Vx /= SqrtK; Vy /= SqrtK; if (l < 0.00001) break; } printf("%.2f", S); fclose(stdout); } int main() { Load(); Solve(); return 0; } Re: Please, explain me, why I have CE with this code? (C++) 'M_PI' : undeclared identifier and comment the string freopen("input.txt", "r", stdin); |
|
|