Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement