First, do not be intimidated by the atan (x) formula!
There are two ways to do this:
1. derivation formula:
1. Tan (a + B) = (TAN (A) + Tan (B)/(1-Tan (a) * Tan (B ))
2. Tan (atan (x) = x
Arctan (1/S) = arctan (1/u) + arctan (1/V)
So we get 1/S = tan (arctan (1/u) + arctan (1/V) = (TAN (arctan (1/U )) + Tan (arctan (1/V)/(1-Tan (arctan (1/U) * Tan (arctan (1/V ))) = (1/u + 1/V)/(1-1/(UV ))
So UV = 1 + US +
Finally, it can be launched. No matter what you enter, the result is 1 ....
Second, use the formula atan (x) in <math. h> to solve the problem. But there is a problem here, and the final result should be adjusted. Generally, Int Is Used for conversion, but the result is always wa! Failed to explain (I hope you can give me some advice on this blog )! What's more strange is that printf ("%. 0lf \ n", k) has passed. The function of this statement is not only to output the integer part. It does not seem to be different from int conversion?
ACCode:
# Include <iostream> using namespace STD; int main () {int t; Double P; CIN> T; while (t --) {CIN> P; cout <1 <Endl;} return 0 ;}
# Include <iostream> # include <math. h> using namespace STD; int main () {double S, U, V; int t; CIN> T; while (t --) {CIN> S> U; double P = atan (1.0/S)-atan (1.0/U); V = 1.0/TAN (P ); double K = V * u-s * V; printf ("%. 0lf \ n ", k); // cout <int (V * u-s * V) <Endl; // wa} return 0 ;}