-
Notifications
You must be signed in to change notification settings - Fork 0
/
cifri.cpp
57 lines (55 loc) · 1.81 KB
/
cifri.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
50
51
52
53
54
55
56
57
#include<iostream>
using namespace std;
int main(){
unsigned long long int a[3];
short int b[3],shots[3];
for(int i=0;i<3;i++)
{
cin>>a[i]>>b[i]>>shots[i];
if(shots[i] == 4){
if(b[i]>=30){
a[i]++;
b[i]=30 - (60-b[i]);
}else{
b[i]+=30;
}
}
if(shots[i] == 3) a[i]+=1;
if(shots[i] == 2) {
a[i]+=1;
if(b[i]>=30){
a[i]++;
b[i]=30 - (60-b[i]);
}else{
b[i]+=30;
}
}
if(shots[i] == 1) a[i]+=2;
if(shots[i] == 0) {
a[i]+=2;
if(b[i]>=30){
a[i]++;
b[i]=30 - (60-b[i]);
}else{
b[i]+=30;
}
}
}
if(a[0]<a[1] and a[0]<a[2]) cout<<a[0]<<" "<<b[0]<<" A";
if(a[1]<a[0] and a[1]<a[2]) cout<<a[1]<<" "<<b[1]<<" B";
if(a[2]<a[0] and a[2]<a[1]) cout<<a[2]<<" "<<b[2]<<" C";
if(a[0]==a[1] and a[0]<a[2] and b[0]<b[1]) cout<<a[0]<<" "<<b[0]<<" A";
if(a[0]==a[1] and a[1]<a[2] and b[1]<b[0]) cout<<a[1]<<" "<<b[1]<<" B";
if(a[0]==a[2] and a[2]<a[1] and b[2]<b[0]) cout<<a[2]<<" "<<b[2]<<" C";
if(a[0]==a[2] and a[0]<a[1] and b[0]<b[2]) cout<<a[0]<<" "<<b[0]<<" A";
if(a[2]==a[1] and a[2]<a[0] and b[2]<b[1]) cout<<a[2]<<" "<<b[2]<<" C";
if(a[2]==a[1] and a[1]<a[0] and b[1]<b[2]) cout<<a[1]<<" "<<b[1]<<" B";
if(a[0]==a[1]==a[2] and b[0]<b[1] and b[0]<b[2]) cout<<a[0]<<" "<<b[0]<<" A";
if(a[0]==a[1]==a[2] and b[1]<b[0] and b[1]<b[2]) cout<<a[1]<<" "<<b[1]<<" B";
if(a[0]==a[1]==a[2] and b[2]<b[0] and b[2]<b[1]) cout<<a[2]<<" "<<b[2]<<" C";
/*cout<<a[0]<<" "<<b[0]<<" A"<<endl;
cout<<a[1]<<" "<<b[1]<<" B"<<endl;
cout<<a[2]<<" "<<b[2]<<" C"<<endl;
*/
return 0;
}