Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int won = 0, lost = 0, drawn = 0;
- string gameResult;
- for (int i = 0; i < 3; i++) {
- cin >> gameResult;
- int teamOneResult = (int)gameResult[0];
- int teamTwoResult = (int)gameResult[2];
- if (teamOneResult > teamTwoResult) {
- won++;
- }
- else if (teamTwoResult > teamOneResult) {
- lost++;
- }
- else {
- drawn++;
- }
- }
- cout << "Team won " << won << " games.\n"
- << "Team lost " << lost << " games.\n"
- << "Drawn games: " << drawn << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement