Answers for "cat and a mouse hackerrank solution in c"

C++
0

cat and a mouse hackerrank solution in c

#include<bits/stdc++.h>
using namespace std;

int main(){

    int q;

    cin >> q;
    for(int i = 0; i < q; i++){
        int a,b,c;
        cin >> a >> b >> c;
        abs(a-c) < abs(b-c) ? cout << "Cat A" : abs(b-c) < abs(a-c) ? cout << "Cat B" : cout << "Mouse C";
        cout << endl;
    }
    return 0;
}
Posted by: Guest on June-29-2020

Code answers related to "cat and a mouse hackerrank solution in c"

Browse Popular Code Answers by Language