Can anyone tell me what is wrong with my code? Problem code:LEADGAME

#include
#include
using namespace std;

int main() {
int N;
cin>>N;
int count, win, winn=0;
for(int i=0; i<N; i++){
int f,l;
cin>>f>>l;
int d, w=0;
if(f>l){
d=f-l;
w=1;
}
else if(l>f){
d=l-f;
w=2;
}
else{
d=0;
w=0;
}
if(count==0){
win=d;
winn=w;
}
if(d>win){
win=d;
winn=w;
}
count+=1;
}
cout<<winn<<" "<<win<<endl;
return 0;
}

Next time, try using code snippets in markdown. It would be much easier to read code then.

1 Like

where are the header files ??

TO GET BETTER REPONSES :

  • Provide link to your WA solution or a properly formatted WA code.
  • Write your approach.

Nobody will read or answer your query if you just paste a ugly looking code with no syntax and no comments to understand what you are trying to do…