-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCard Names.c
More file actions
31 lines (29 loc) · 764 Bytes
/
Card Names.c
File metadata and controls
31 lines (29 loc) · 764 Bytes
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
#include <stdio.h>
//chia 13 de tim ra chat cua la bai
//%13 de tim ra so cua la bai
int main(void) {
int a;
int b[100], rank[100];
int out[100],value[100];
scanf("%d", &a);
for(int i=0; i<a; i++)
{
scanf("%d", &b[i]);
value[i]=b[i]%13;
rank[i]=b[i]/13;
}
for(int i=0; i<a; i++)
{
if(value[i]==9) printf("Jack-of-");
else if(value[i]==10) printf("Queen-of-");
else if(value[i]==11) printf("King-of-");
else if(value[i]==12) printf("Ace-of-");
else if(value[i]<9) printf("%d-of-", value[i]+2);
//printf("%d", value[i]);
if(rank[i]==0) printf("Clubs ");
else if(rank[i]==1) printf("Spades ");
else if(rank[i]==2) printf("Diamonds ");
else if(rank[i]==3) printf("Hearts ");
}
return 0;
}