#include <vector> #include <iostream> #include <string> using namespace std; struct box{ int x, y; bool operator==(const box& rhs) // 操作运算符重载 { return(x == rhs.x) && (y == rhs.y); } }a[6]; int main() { for (int i = 0; i < 6; i++) { cin >> a[i].x >> a[i].y; if (a[i].x < a[i].y) swap(a[i].x, a[i].y); } for (int i = 0; i < 6; i++) { for (int j = 0; j < 5 - i; j++) if (a[j].x < a[j + 1].x) swap(a[j], a[j + 1]); else { if (a[j].x == a[j + 1].x&&a[j].y < a[j + 1].y) swap(a[j], a[j + 1]); } } bool s = 0; if (a[0] == a[1] && a[2] == a[3] && a[4] == a[5]) { if (a[0].x == a[2].x && a[2].y == a[4].y && a[0].y == a[4].x) s = 1; } cout << s << endl; return 0; }
3-10 盒子 UVa1587
猜你喜欢
转载自blog.csdn.net/fuwu4087/article/details/80382102
今日推荐
周排行