标签:lse inf ora mes image line ima str bsp
1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 5 int main() 6 { 7 double r1, r2, p1, p2; 8 cin >> r1 >> p1 >> r2 >> p2; 9 double fact1 = r1 * r2 * ( cos(p1) * cos(p2) - sin(p1) * sin(p2) ); 10 double fact2 = r1 * r2 * ( cos(p1) * sin(p2) + sin(p1) * cos(p2) ); 11 if(fabs(fact1) < 0.005) 12 { 13 fact1 = 0; 14 } 15 if(fabs(fact2) < 0.005) 16 { 17 fact2 = 0; 18 } 19 if(fact2 < 0) 20 printf("%.2lf%.2lfi\n",fact1, fact2); 21 else 22 printf("%.2lf+%.2lfi\n",fact1, fact2); 23 return 0; 24 }
标签:lse inf ora mes image line ima str bsp
原文地址:https://www.cnblogs.com/Anber82/p/11133432.html