1371Problem A:化学题
2017-12-02 18:17
148 查看
#include <stdio.h> // Fnlock // 这题就是字符串问题 int main(int argc,const char *argv[]) { int n; int i; scanf("%d",&n); getchar(); char arr[110]; int t=0; while(n--) { t=0; gets(arr); for(i=0; arr[i]!='\0';i++) { if(arr[i]=='C') t+=12; else if(arr[i]=='H') t+=1; else t+=16; } printf("%d\n",t); } return 0; }
相关文章推荐
- HTML显示的算术式与化学表达式
- ZOJ Problem Set - 2001 Adding Reversed Numbers
- 1199:A+B Problem
- hdu--5055 Bob and math problem
- Yast: SSL certificate problem, verify that the CA cert is OK
- 欧拉项目——Problem21(改进版)
- vector-- The Blocks Problem
- 例题 5-2 木块问题 (The Blocks Problem) UVa 101
- Unknown Faceted Project Problem (Java Version Mismatch)
- poj3468 A Simple Problem with Integers
- A+B Problem
- Problem 1082 最大黑区域
- UVA - 524:Prime Ring Problem
- Problem B: 怎么报数? 信息杯班级对抗赛
- Problem B
- UVA10025 The ? 1 ? 2 ? ... ? n = k problem
- UVA - 10026 Shoemaker's Problem
- UVa-101 The Blocks Problem(栈模拟)
- 第十六周 Problem B:有相同的数字
- 2016西电校赛网络赛 Problem D 抢人头