-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareTheTriplet.cpp
More file actions
38 lines (30 loc) · 988 Bytes
/
CompareTheTriplet.cpp
File metadata and controls
38 lines (30 loc) · 988 Bytes
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
/*
Alice and Bob each created one problem for HackerRank Compare the Triplets.
A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories:
problem clarity, originality, and difficulty.
We define the rating for Alice’s challenge to be the triplet A=(a0,a1,a2), and the rating for Bob’s challenge
to be the triplet B=(b0,b1,b2).
*/
#include<iostream>
using namespace std;
int main()
{
int aliceResult = 0;
int bobResult = 0;
int alicePoints[3],bobPoints[3];
for(int i = 0;i<3;i++){
cin>>alicePoints[i];
}
for(int i = 0;i<3;i++){
cin>>bobPoints[i];
}
for(int i = 0;i<3;i++){
if(alicePoints[i]>bobPoints[i]){
aliceResult++;
}else if(alicePoints[i]<bobPoints[i]){
bobResult++;
}
}
cout<<aliceResult<<" "<<bobResult;
return 0;
}