-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6-3.cpp
64 lines (61 loc) · 1005 Bytes
/
6-3.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void pt(int a){
switch(a){
case 0: cout <<"÷»¨";break;
case 1: cout <<"·½¿é";break;
case 2: cout <<"ºìÌÒ";break;
case 3: cout <<"ºÚÌÒ";break;
}
}
void ptd(int b){
if(b<10){
cout << b+1;
}
else if(b==10){
cout << 'J';
}
else if(b==11){
cout << 'Q';
}
else if(b=='K'){
cout << 'K';
}
else
cout<<'A';
}
int myrand(){
int rs = 1+rand()%52;
return rs;
}
void prtsq(int a){
int a0 = a/13;
int b0 = a%13;
pt(a0);
ptd(b0);
}
void todo(int a,int g,int point[]){
point[g]+=(a%13>=10?a%13-9:0);
}
int main(){
bool flag[52]={0};
srand((int)time(0));
int point[4]={0};
for(int i = 0 ; i < 52 ; i++){
int tmp = myrand();
if(flag[tmp-1]){
i--;
continue;
}
else{
flag[tmp-1]=true;
todo(tmp-1,i/13,point);
}
}
for(int i = 0 ; i<4 ; i++){
cout <<"Points of Group "<<i<<" : "<<point[i]<<endl;
}
return 0;
}