-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path2949.c
57 lines (41 loc) · 884 Bytes
/
2949.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define true 1
#define false 0
/*
* -----------------------------------
* | Pedro Daniel Jardim |
* | UFV |
* | 01/03/2020 |
* ----------------------------------
*
*/
int main(int argc, char **argv)
{
int n;
char c;
char nome[100];
int ans[5] = { 0 };
scanf("%d", &n);
while (n--)
{
scanf("%s %c", nome, &c);
if (c == 'X')
ans[0]++;
else if (c == 'H')
ans[1]++;
else if (c == 'E')
ans[2]++;
else if (c == 'A')
ans[3]++;
else
ans[4]++;
}
printf("%d Hobbit(s)\n", ans[0]);
printf("%d Humano(s)\n", ans[1]);
printf("%d Elfo(s)\n", ans[2]);
printf("%d Anao(s)\n", ans[3]);
printf("%d Mago(s)\n", ans[4]);
return 0;
}