File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ #include < set>
3
+ #include < string>
4
+ using namespace std ;
5
+ int main ()
6
+ {
7
+ string s;
8
+ set<char > st;
9
+ getline (cin, s);
10
+ for (char ch : s)
11
+ {
12
+ if (isalpha (ch))
13
+ {
14
+ st.insert (ch);
15
+ }
16
+ }
17
+ cout << st.size () << endl;
18
+ return 0 ;
19
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+ int main ()
4
+ {
5
+ int n, c = 0 ;
6
+ string s;
7
+ cin >> n;
8
+ for (int i = 0 ; i < n; i++)
9
+ {
10
+ cin >> s;
11
+ if (s == " Tetrahedron" )
12
+ {
13
+ c += 4 ;
14
+ }
15
+ else if (s == " Cube" )
16
+ {
17
+ c += 6 ;
18
+ }
19
+ else if (s == " Octahedron" )
20
+ {
21
+ c += 8 ;
22
+ }
23
+ else if (s == " Dodecahedron" )
24
+ {
25
+ c += 12 ;
26
+ }
27
+ else
28
+ {
29
+ c += 20 ;
30
+ }
31
+ }
32
+ cout << c << endl;
33
+ return 0 ;
34
+ }
You can’t perform that action at this time.
0 commit comments