Codeforces Round #404 (Div. 2) A - Anton and Polyhedrons 水题

A - Anton and Polyhedrons

题目连接:

http://codeforces.com/contest/785/problem/A

Description

Anton's favourite geometric figures are regular polyhedrons. Note that there are five kinds of regular polyhedrons:

Tetrahedron. Tetrahedron has 4 triangular faces.

Cube. Cube has 6 square faces.

Octahedron. Octahedron has 8 triangular faces.

Dodecahedron. Dodecahedron has 12 pentagonal faces.

Icosahedron. Icosahedron has 20 triangular faces.

All five kinds of polyhedrons are shown on the picture below:

Anton has a collection of n polyhedrons. One day he decided to know, how many faces his polyhedrons have in total. Help Anton and find this number!

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 200 000) — the number of polyhedrons in Anton's collection.

Each of the following n lines of the input contains a string si — the name of the i-th polyhedron in Anton's collection. The string can look like this:

"Tetrahedron" (without quotes), if the i-th polyhedron in Anton's collection is a tetrahedron.

"Cube" (without quotes), if the i-th polyhedron in Anton's collection is a cube.

"Octahedron" (without quotes), if the i-th polyhedron in Anton's collection is an octahedron.

"Dodecahedron" (without quotes), if the i-th polyhedron in Anton's collection is a dodecahedron.

"Icosahedron" (without quotes), if the i-th polyhedron in Anton's collection is an icosahedron.

Output

Output one number — the total number of faces in all the polyhedrons in Anton's collection.

Sample Input

4

Icosahedron

Cube

Tetrahedron

Dodecahedron

Sample Output

42

Hint

题意

给你一堆多面体,然后问你总共多少个面。

题解:

实际上只需要if if if if就好了嘛

代码

#include<bits/stdc++.h>
using namespace std;
int n,ans=0;
string s;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>s;
if(s=="Tetrahedron")ans+=4;
if(s=="Cube")ans+=6;
if(s=="Octahedron")ans+=8;
if(s=="Dodecahedron")ans+=12;
if(s=="Icosahedron")ans+=20;
}
cout<<ans<<endl;
}
上一篇:Soft-to-Hard Vector Quantization for End-to-End Learning Compressible Representations


下一篇:JQuery: JQuery效果(隐藏、显示、切换,滑动,淡入淡出,以及动画)