zoukankan      html  css  js  c++  java
  • A. Who is the winner?

    A big marathon is held on Al-Maza Road, Damascus. Runners came from all over the world to run all the way along the road in this big marathon day. The winner is the player who crosses the finish line first.

    The organizers write down finish line crossing time for each player. After the end of the marathon, they had a doubt between 2 possible winners named "Player1" and "Player2". They will give you the crossing time for those players and they want you to say who is the winner?

    Input

    First line contains number of test cases (1  ≤  T  ≤  100). Each of the next T lines represents one test case with 6 integers H1 M1 S1 H2 M2 S2. Where H1, M1, S1 represent Player1 crossing time (hours, minutes, seconds) and H2, M2, S2 represent Player2 crossing time (hours, minutes, seconds). You can assume that Player1 and Player2 crossing times are on the same day and they are represented in 24 hours format(0  ≤  H1,H2  ≤  23 and 0  ≤ M1,M2,S1,S2  ≤  59)

    H1, M1, S1, H2, M2 and S2 will be represented by exactly 2 digits (leading zeros if necessary).

    Output

    For each test case, you should print one line containing "Player1" if Player1 is the winner, "Player2" if Player2 is the winner or "Tie" if there is a tie.

    Examples
     
    input
    3
    18 03 04 14 03 05
    09 45 33 12 03 01
    06 36 03 06 36 03
     
    output
    Player2
    Player1
    Tie

     1 #include <iostream>
     2 #include <stdio.h>
     3 using namespace std;
     4 
     5 int main()
     6 {   int t,a,b,c,a1,b1,c1;
     7    scanf("%d",&t);
     8    while(t--){
     9     scanf("%d%d%d%d%d%d",&a,&b,&c,&a1,&b1,&c1);
    10     if(a>a1) printf("Player2
    ");
    11     else if(a<a1) printf("Player1
    ");
    12     else if(b>b1) printf("Player2
    ");
    13     else if(b<b1) printf("Player1
    ");
    14     else if(c>c1) printf("Player2
    ");
    15     else if(c<c1) printf("Player1
    ");
    16     else printf("Tie
    ");
    17    }
    18     return 0;
    19 }
  • 相关阅读:
    Leetcode-Minimum Depth of Binary Tree
    Leetcode-Path Sum II
    Leetcode-Path Sum
    Leetcode-Flatten Binary Tree to Linked List
    Leetcode-Populating Next Right Pointer in Binary Tree II
    Leetcode-Pascal's Triangle II
    Leetcode-Pascal's Triangle
    Leetcode-Triangle
    第10月第20天 afnetwork like MKNetworkEngine http post
    第10月第13天 xcode ipa
  • 原文地址:https://www.cnblogs.com/z-712/p/7323461.html
Copyright © 2011-2022 走看看