Skip to content

Instantly share code, notes, and snippets.

@Jordach
Created October 18, 2012 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jordach/3912475 to your computer and use it in GitHub Desktop.
Save Jordach/3912475 to your computer and use it in GitHub Desktop.
#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