CodeForces 785A Anton and Polyhedrons

时间:2023-03-10 06:03:20
CodeForces 785A Anton and Polyhedrons

简单判断。

分别判断每个单词是几面体,加起来就是答案。

#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <algorithm>
using namespace std; int n;
char s[1000];
int sum; int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%s",s);
if(s[0]=='T') sum+=4;
if(s[0]=='C') sum+=6;
if(s[0]=='O') sum+=8;
if(s[0]=='D') sum+=12;
if(s[0]=='I') sum+=20; }
printf("%d\n",sum);
return 0;
}