Skip to content

Instantly share code, notes, and snippets.

@Jordach

Jordach/gist:3912475

Created Oct 18, 2012
Embed
What would you like to do?
#include <iostream>
using namespace std;
int goals_of_first_team;
int goals_of_second_team;
int points_of_ManC;
int points_of_ManU;
int main()
{
points_of_ManC = 0;
points_of_ManU = 0;
cout << "This is the first game of the season; enter the goals scored by both teams. \n";
cout << "Enter the goals for Manchester City: ";
cin >> goals_of_first_team;
cout << "Enter the goals for Manchester United: ";
cin >> goals_of_second_team;
if (goals_of_first_team == goals_of_second_team)
{
cout << "Manchester City drew with Manchester United. \n";
points_of_ManU = points_of_ManU + 1;
points_of_ManC = points_of_ManC + 1;
}
if (goals_of_first_team < goals_of_second_team)
{
cout << "Manchester United won the game! \n";
points_of_ManU = points_of_ManU + 3;
}
if (goals_of_first_team > goals_of_second_team)
{
cout << "Manchester City won the game! \n";
points_of_ManC = points_of_ManC + 3;
}
cout << "The point standings are: \n Manchester City with: " << points_of_ManC << "\n Manchester United with: " << points_of_ManU << "";
cin >> points_of_ManU;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment