正文
增加 4 行删除 4 行
23 行未改动24252627282930313233343536373839404142434445464 行未改动23 行未改动#include <bits/stdc++.h>using namespace std;typedef long long ll;const double r = 6440; //地球半径int main() {double s, a;//s:卫星与地球表面的距离,a:两颗卫星对地球中心的夹角string str;while (cin >> s >> a >> str) {if (str[0] == 'm') {a /= 60;//分转换为度}double angle = M_PI * a / 180;double arc = angle * (s + r);//圆弧距离double dis = 2 * (s + r) * sin(angle / 2);//直线弦距离if (a > 180) {//夹角大于180度arc = 2 * M_PI * (s + r) - arc;}cout << fixed << setprecision(6) << arc;cout << " ";cout << fixed << setprecision(6) << dis;cout << "\n";4 行未改动23 行未改动24252627282930313233343536373839404142434445464 行未改动23 行未改动#include <bits/stdc++.h>using namespace std;typedef long long ll;const double r = 6440; //地球半径int main() {double s, a;//s:卫星与地球表面的距离,a:两颗卫星对地球中心的夹角string str;while (cin >> s >> a >> str) {if (str[0] == 'm') {a /= 60;//分转换为度}double angle = M_PI * a / 180;double arc = angle * (s + r);//圆弧距离double dis = 2 * (s + r) * sin(angle / 2);//直线弦距离if (a > 180) {//夹角大于180度arc = 2 * M_PI * (s + r) - arc;}cout << fixed << setprecision(6) << arc;cout << " ";cout << fixed << setprecision(6) << dis;cout << "\n";4 行未改动