首页 > 其他 > 详细

CodeForces 785A Anton and Polyhedrons

时间:2017-05-17 19:06:44      阅读:392      评论:0      收藏:0      [点我收藏+]

简单判断。

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

#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;
}

CodeForces 785A Anton and Polyhedrons

原文:http://www.cnblogs.com/zufezzt/p/6868924.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!