小白题解 Codeforces 785A
来源:互联网 发布:河南网络电视台直播 编辑:程序博客网 时间:2024/06/03 14:49
(水题)题目链接:点击打开链接
题目大意:给定4种几何体,知道每一种几何体的面数,现给出n个这四种几何体,问一共有多少面。
分析:读取每一个几何体,根据名称的首字母判定是哪种几何体,加上对应几何体的面数即可。
下面是AC代码
#include<cstdio>int main(){ int n; char s[15]; int tot=0; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%s",&s); switch(s[0]) { case 'T': tot+=4; break; case 'C': tot+=6; break; case 'O': tot+=8; break; case 'D': tot+=12;break; case 'I': tot+=20;break; } } printf("%d\n",tot); return 0;}
阅读全文
0 0
- 小白题解 Codeforces 785A
- 小白题解 Codeforces 794A Bank Robbery
- 小白题解 Codeforces 805A Fake NP
- 小白题解 Codeforces 807A Is it rated?
- 小白题解 Codeforces 798A Mike and palindrome
- 小白题解 Codeforces 804A Find Amir
- 小白题解 Codeforces 266A Stones on the Table
- 小白题解 Codeforces 1A Theatre Square
- 小白题解 Codeforces 785B Anton and Classes
- codeforces A. Cakeminator 题解
- codeforces A. TL 题解
- codeforces A. Array题解
- codeforces 150A 题解
- Codeforces A. Double Cola 题解
- codeforces A. IQ test 题解
- codeforces A. Supercentral Point 题解
- codeforces A. k-String 题解
- Codeforces 115A Party 题解
- MSSql 链接服务器 openquery 多表联合 更新
- 表中-list接口ArrayList类和LinkedList类
- .ipynb文件转换成HTML文件出现找不到python kernel的解决方案
- 使用mybatis 通用Mapper类的笔记
- Windows下在某个目录下的所有文件中查找特定字符串
- 小白题解 Codeforces 785A
- socket 网络编程教程
- 算法设计与应用基础
- CF803D:Magazine Ad(二分)
- 使用防抖动(debounce)优化页面滚动
- Python: PS 图像调整--颜色梯度
- netdiscover
- 页面预加载loading动画,再载入内容
- 【如何快速的开发一个完整的iOS直播app】(采集篇)