Last active
August 3, 2016 14:43
-
-
Save CraigRodrigues/d6c38e2d5f42031b5ee1f684046de7c0 to your computer and use it in GitHub Desktop.
HackerRank - Algorithms - Warmup - Compare the Triplets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include <stdbool.h> | |
int main(){ | |
int alice_score = 0; | |
int bob_score = 0; | |
int a0; | |
int a1; | |
int a2; | |
scanf("%d %d %d",&a0,&a1,&a2); | |
int b0; | |
int b1; | |
int b2; | |
scanf("%d %d %d",&b0,&b1,&b2); | |
(a0 == b0) ? : ((a0 > b0) ? alice_score++ : bob_score++); | |
(a1 == b1) ? : ((a1 > b1) ? alice_score++ : bob_score++); | |
(a2 == b2) ? : ((a2 > b2) ? alice_score++ : bob_score++); | |
printf("%i %i", alice_score, bob_score); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment