В " Visual Studio Code " нямам грешка, а в judge имам ?!
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main()
{
int matches = 0, win = 0, lose = 0, draw = 0;
while (matches < 3)
{
string result;
cin >> result;
char ch = result[0] - 48; char ch1 = result[2] - 48;
int team = ch; int team1 = ch1;
if (team > team1)
{
win++;
}
else if(team < team1){
lose++;
}
else {
draw++;
}
matches++;
}
cout << "Team won " << win << " games.\n";
cout << "Team lost " << lose << " games.\n";
cout << "Drawn games: " << draw;
}
Същата, която коментирахме преди малко.