View difference between Paste ID: DGaHLDHQ and dGbJdv29
SHOW: | | - or go back to the newest paste.
1
#include <iostream>
2
#include <cmath>
3
#include <string>
4
5
using namespace std;
6
7
int main()
8
{
9
	int matches = 0, win = 0, lose = 0, draw = 0;
10
11
	while (matches < 3)
12
	{
13
		string result;
14
		cin >> result;		
15
		
16
		char ch = result[0] - 48; char ch1 = result[2] - 48;
17
18
			int team = ch; int team1 = ch1;
19
20-
			if (team > team1)
20+
			if (team > team1){
21-
			{
21+
22
			}
23
			else if(team < team1){
24
				lose++;
25
			}
26
			else{
27-
			else {
27+
28
			}	
29
30
		matches++;
31
	}
32
	cout << "Team won " << win << " games.\n";
33
34
	cout << "Team lost " << lose << " games.\n";
35
	
36
	cout << "Drawn games: " << draw;
37
}