Hi!
My assignment is to write a program where you write in two sport teams, home teams and guest team and their reults. After the program will output information who won and if there were a tie. I tried to translate okay from Swedish!
The program isn't working and there are no error message.
Can someone help me!
CMD displays the first output, but after that the program shuts down with an error message.
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
string home, guest, hnr, bnr;
cout << "Title" << endl;
cout << "----------------" << endl;
cout << "Write name of home team: "; cin >> home;
cout << "How many goals did" + home; cin >> hnr;
cout << "Write name of guest team: "; cin >> guest;
cout << "How many goals did " + guest; cin >> bnr;
if (hnr > bnr)
{
cout << home << " won against "
<< guest << "The resultat were "
<< hnr << "-" << bnr;
}
else if (hnr < bnr)
{
cout << guest << " guest won over "
<< home << ". Final result "
<< hnr << "-" << bnr;
}
else (hnr && bnr);
{
cout << Tie between "
<< home << " and "
<< guest << ". The match ended with "
<< hnr << "-" << bnr;
}
}