POJ 2840
#include<iostream>
#include<stdio.h>
#include<string> using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
int i;
int num;
int sum;
string s;
cin>>num;
while(num --)
{
cin>>s;
i = ;
sum = ;
while()
{
sum += s[i] - '';
if(s[++i] != ':')
sum *= ;
else
break;
} if(s[++i] == '' && s[++i] == '')
{
if(sum == )
cout<<<<endl;
else
cout<<(sum + ) % <<endl;
}
else
{
cout<<<<endl;
} }
}
POJ 2840的更多相关文章
- Poj 2840 Big Clock
1.Link: http://poj.org/problem?id=2840 2.Content: Big Clock Time Limit: 1000MS Memory Limit: 13107 ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
随机推荐
- 使用express框架和mongoose在MongoDB新增数据
1.安装 express npm i express --save 2.安装 mongoDB npm i mongodb --save 3.安装mongoose npm i mongoose --sa ...
- C语言常用数据类型说明
1.取值范围: short一般占两个字节,取值范围:-32768 - 32767 int一般占两个或四个字节,取值范围:-2147483648 - 2147483647 unsigned int ...
- 安卓修改开机logo和开机动画的方法
第一种和第二种方法亲测可用,安卓版本是4.2和安卓5.1均可.第二种方法待验证 以下三种方法 Android 开机其实总共会出现3个画面: 1.第一个就是 linux 系统启动,出现Linux小企鹅画 ...
- altera FIFO知识点
虽然是很常用的IP,但经常用时还要看下文档,某些知识点如果能记住的话,还是可以节省很多时间的. (1)输入输出位宽不相等 这里以输入16位数据输出为8位数据为例,写入两16位的数据,读出4个8位的 ...
- js中的事件代理(委托)
1,什么是事件委托:通俗的讲,事件就是onclick,onmouseover,onmouseout,等就是事件,委托呢,就是让别人来做,这个事件本来是加在某些元素上的,然而你却加到别人身上来做,完成这 ...
- day25(令牌机制)
令牌机制 作用:处理页面重复提交,造成数据多次写入数据库. 使用方法: 类似于验证码机制,使用session记录一个不可能重复的值(Uuid)在访问controller时对session进行校验. / ...
- (最长上升子序列 并记录过程)FatMouse's Speed -- hdu -- 1160
http://acm.hdu.edu.cn/showproblem.php?pid=1160 FatMouse's Speed Time Limit: 2000/1000 MS (Java/Other ...
- 【python-pip】pip安装国外插件timeout解决方案
为什么会timeout呢,你懂得(不懂???!!!) 解决方案: 使用国内豆瓣镜像安装(也有其他的镜像,自己可以搜) pip install xxx -i http://pypi.douban.com ...
- zoj3820
题意:给定一个树,找出两个点,使得其他点到最近的点的距离最小 思路: 牡丹江站的B题..可惜当时坑的不大对,最后也没写完.. 1.题解方法: 基于一个结论,答案一定在直径上(证明我不会).. 那么,可 ...
- 加密算法比较3DES AES RSA ECC MD5 SHA1等
加 密算法通常分为对称性加密算法和非对称性加密算法,对于对称性加密算法,信息接收双方都需事先知道密匙和加解密算法且其密匙是相同的,之后便是对数据进行 加解密了.非对称算法与之不同,发送双方A,B事先均 ...