-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dice Number.cpp
49 lines (41 loc) · 901 Bytes
/
Dice Number.cpp
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
41
42
43
44
45
46
47
48
49
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n ;cin>>n;
while(n--){
char a1,a2,a3,b1,b2,b3;
cin>>a1>>a2>>a3>>b1>>b2>>b3;
string s1,s2;
// s1=s2="";
s1+=a1; //cout<<"s1: "<<s1<<endl;
s1+=a2; //cout<<"s1: "<<s1<<endl;
s1+=a3; // cout<<"s1: "<<s1<<endl;
s2+=b1;
s2+=b2;
s2+=b3;
sort(s1.begin(),s1.end());
sort(s2.begin(),s2.end());
// for(int i=0;i<s1.size();i++)
// cout<<s1[i];
// cout<<endl;
// for(int i=0;i<s1.size();i++)
// cout<<s2[i];
// cout<<endl;
reverse(s1.begin(),s1.end());
reverse(s2.begin(),s2.end());
int a, b;
a=stoi(s1);
b=stoi(s2);
if(a<b)
cout<<"Bob"<<endl;
else if(a>b)
cout<<"Alice"<<endl;
else
cout<<"Tie"<<endl;
}
return 0;
}