The code gives 80% accuracy isn't it obvious that person who has more chances will win?

#include
using namespace std;

void winner(int t)
{
int i,n,m;
for(i=1;i<=t;i++)
{
cin>>m>>n;
if(m>n)
cout<<“Aayush”<<endl;
else if(m<n)
cout<<“Harshit”<<endl;
else if(m=n)
cout<<“Aayush”<<endl;

}

}

int main() {
int n;
cin>>n;
winner(n);
return 0;
}

Please print Harshit in case of m equals n and see if the cases pass.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Still not working despite printing Harshit in case of m equals n.

hi @muskanrathore01_4aab76aa7dafc189
refer this -->

#include <iostream>
using namespace std;

void shoppingGame(int m, int n){
    int counterAyush, counterHarshit;
    int sumAyush = 0, sumHarshit = 0;
    for(counterAyush = 1; sumAyush<=m; counterAyush += 2){
        sumAyush += counterAyush;
    }

    for (counterHarshit = 2; sumHarshit<=n; counterHarshit += 2){
        sumHarshit += counterHarshit;
    }

    if (counterAyush > counterHarshit){
        cout << "Aayush" << endl;
    }

    else {
        cout << "Harshit" << endl;
    }
}

int main(){
    int noOfTestCases;
    int m, n; // m is max limit of smartphones that ayush can buy and n for harshit
    cin >> noOfTestCases;
    for (int i = 1; i<=noOfTestCases; i++){
        cin >> m >> n;
        shoppingGame(m, n);
    }


    return 0;
}

hi @muskanrathore01_4aab76aa7dafc189
also u have written m=n while it should be m == n

Your code is also not working still gives many errors and even after correcting m==n in my code it has 80% accuracy

hi @muskanrathore01_4aab76aa7dafc189
there is some compiler issue that’s why its showing one test case as failed… earlier the same code was passing all test cases… so don’t worry, move ahead with other questions…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.