Skip to content

Commit b2530ad

Browse files
committed
new one
1 parent 585cf9c commit b2530ad

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

bar.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
ios::sync_with_stdio(false);
7+
cin.tie(0);
8+
set<string>s;
9+
s.insert("ABSINTH"); s.insert("BEER"); s.insert("BRANDY"); s.insert("CHAMPAGNE"); s.insert("GIN");
10+
s.insert("RUM"); s.insert("SAKE"); s.insert("TEQUILA"); s.insert("VODKA"); s.insert("WHISKEY"); s.insert("WINE");
11+
int n;
12+
cin>>n;
13+
string s1;
14+
int count=0;
15+
for(int i=0; i<n; i++)
16+
{
17+
cin>>s1;
18+
if(s.count(s1)) count+=1;
19+
else if(s1[0]>='0'&&s1[0]<='9'){
20+
if(stoi(s1)<18)
21+
count+=1;
22+
else
23+
continue;
24+
}
25+
}
26+
cout<<count<<endl;
27+
return 0;
28+
}

0 commit comments

Comments
 (0)