标签:
1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 int a[9], b[9]; 8 struct{ 9 int a, b; 10 }c[10]; 11 12 bool check(int i, int j) 13 { 14 if(c[i].a > c[j].b && c[i].b > c[j].a) 15 return 1; 16 return 0; 17 } 18 19 int main() 20 { 21 int i; 22 for(i = 1; i <= 4; i++) { 23 scanf("%d%d", &a[i], &b[i]); 24 } 25 c[1].a = a[1]; 26 c[1].b = b[2]; 27 c[2].a = a[2]; 28 c[2].b = b[1]; 29 c[3].a = a[3]; 30 c[3].b = b[4]; 31 c[4].a = a[4]; 32 c[4].b = b[3]; 33 int team = 0; 34 if((check(1,3) && check(1,4)) || (check(2,3) && check(2,4))) { 35 team = 1; 36 } 37 else if((check(3,1) || check(4,1)) && (check(3,2) || check(4,2))) { 38 team = 2; 39 } 40 if(!team) 41 printf("Draw\n"); 42 else { 43 printf("Team %d\n", team); 44 } 45 }
标签:
原文地址:http://www.cnblogs.com/AC-Phoenix/p/4298836.html