題目:
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1183
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| #include <iostream> #include <iomanip>
using namespace std;
int main(){ ios::sync_with_stdio(0); cin.tie(0);
pair<double, double> a, b, c, d; while(cin >> a.first >> a.second >> b.first >> b.second >> c.first >> c.second >> d.first >> d.second){ pair<double, double> A, B, C, ans; if(a == c){ A = a; B = b; C = d; } else if(a == d){ A = a; B = b; C = c; } else if(b == c){ A = b; B = a; C = d; } else{ A = b; B = a; C = c; } ans.first = B.first + C.first - A.first; ans.second = B.second + C.second - A.second; cout << fixed << setprecision(3) << ans.first << ' ' << ans.second << '\n'; } return 0; }
|