We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 585cf9c commit b2530adCopy full SHA for b2530ad
bar.cpp
@@ -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