Hackerrank solution Compare the triplets - Algorithms Warmup
HackerRank Online Judge Solution Compare the triplets | Algorithms Warmup
HackerRank Main Problem Link -
Problem Name: HackerRank Problem Compare the triplets | Algorithms Warmup
Problem Number : HackerRank Problem Compare the triplets | Algorithms Warmup Solution
Online Judge : HackerRank Online Judge Solution
Category: Algorithm
Solution Language : C, C plus plus
HackerRank Solution Compare the triplets | Algorithms Warmup Code in C,CPP:
#include <stdio.h> int main() { int a0, a1, a2; scanf("%d %d %d", &a0, &a1, &a2); int b0, b1, b2; scanf("%d %d %d", &b0, &b1, &b2); int a=0,b=0; if(a0>b0) a++; else if(a0<b0) b++; if(a1>b1) a++; else if(a1<b1) b++; if(a2>b2) a++; else if(a2<b2) b++; printf("%d %d\n", a,b); return 0; }
Thanks buddy
ReplyDelete