Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, a, b, asum = 0, bsum = 0;
cin>>n;
while(n--){
cin >> a >> b;
if(a > b){
asum++;
continue;
}
if(b > a){
bsum++;
continue;
}
}
if(asum > bsum){
cout<<"Mishka"<<endl;
return 0;
}
if(bsum >asum){
cout<<"Chris"<<endl;
return 0;
}
cout<<"Friendship is magic!^^"<<endl;
return 0;
}
Copy The Code &
Try With Live Editor
Input
3
3 5
2 1
4 2
3 5
2 1
4 2
Output
2
6 1
1 6
6 1
1 6
Demonstration
Codeforcess Solution 703-A A. Mishka and Game ,C++, Java, Js and Python ,703-A,Codeforcess Solution