hdoj 5949 Relative atomic mass
来源:互联网 发布:魔兽争霸windows语言 编辑:程序博客网 时间:2024/05/18 04:36
题目链接:Relative atomic mass
题目大意:给你C、H、O三种元素构成的字符串,算相对原子质量
题目思路:按题意模拟就好
#include <map>#include <set>#include <queue>#include <stack>#include <cmath>#include <vector>#include <cstdio>#include <cstring>#include <cstdlib>#include <iostream>#include <algorithm>using namespace std;typedef long long ll;int main(){ int t; string str; cin>>t; while(t--){ cin>>str; int sum = 0; for(int i = 0;i < str.size();i++){ if(str[i] == 'C') sum += 12; else if(str[i] == 'H') sum += 1; else sum += 16; } cout<<sum<<endl; } return 0;}
阅读全文
0 0
- hdoj 5949 Relative atomic mass
- hdu 5949 Relative atomic mass
- HDU 5949 Relative atomic mass
- hdu 5949 Relative atomic mass
- HDU 5949 Relative atomic mass
- Relative atomic mass
- HDU 5949 Relative atomic mass 【模拟】 (2016ACM/ICPC亚洲区沈阳站)
- hdu 5949 Relative atomic mass 2016ACM/ICPC沈阳赛区现场赛B
- MASS
- MASS
- Atomic
- atomic
- Atomic
- relative
- Mass Storage
- mass spectrometry
- mass storage
- Mass-Niche
- 深度学习系列教程
- wangEditor富文本wangEditor-3.0.7
- [py]django常用配置
- php通用的树型类创建无限级树型菜单
- oracle-关于RR参数
- hdoj 5949 Relative atomic mass
- andorid封装自动滚动TextView,没有焦点,有两种滚动方式
- 492. Construct the Rectangle
- 利用 Adobe Flash Player ActiveX 控件绕过 SafeSEH(问题及解决方法)
- IE下遭遇Ajax缓存导致数据不更新的问题 ajax页面无刷新
- React 实现 Table
- 关于一个项目中全局配置文件读取的注意事项
- SSH
- 前缀和