-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCazino.cpp
43 lines (39 loc) · 881 Bytes
/
Cazino.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
class Carte{
public:
int numar;
string culoare;
public:
Carte(){}
Carte(int nr,string clr){
culoare=clr;
numar=nr;
}
};
int main(){
vector<Carte>carti;
string culoare_citita;
int carte_citita;
int nr_carti;
int x=0;
cin>>nr_carti;
for(int i=0;i<nr_carti;i++){
cin>>carte_citita>>culoare_citita;
carti.push_back(Carte(carte_citita,culoare_citita));
x=0;
for(int j=0;j<carti.size();j++){
if((carte_citita==carti[j].numar)&&(culoare_citita==carti[j].culoare)){
x++;
}
}
if(x>=3){
cout<<carte_citita<<" "<<culoare_citita;
return 0;
}
}
cout<<"JOC OK";
}