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 ...
随机推荐
- IPython:一种交互式计算和开发环境
IPython基础 可以通过命令行启动IPython,执行任何Python语句,只需将其输入然后回车. Tab键自动完成 在Shell中输入表达式时,只要按下Tab键,当前命名空间中任何与已输入的字符 ...
- Echarts饼图显示模板
图表类型,必要参数!如为空或不支持类型,则该系列数据不被显示.可选为: 'line'(折线图) | 'bar'(柱状图) | 'scatter'(散点图) | 'k'(K线图) 'pie'(饼图) | ...
- pytorch总结
PyTorch 深度学习:60分钟快速入门 用例子学习 PyTorch 手把手教你用PyTorch从零搭建图像分类模型
- keras backend的修改
方法一: vim .keras/keras.json 修改“backend”:"tensorflow" 方法二: 每次在python文档中输入, import os os.envi ...
- python,函数
numpy.tile():参考https://www.jianshu.com/p/4b74a367833c numpy.argsort:argsort()里面传入参数只有数组时,返回的是数组值从小到大 ...
- vue中的前置守卫
前置守卫是为了验证用户信息真实性,一些内容只能在用户登陆以后才能进行查看,例如个人中心,我的购物车,等个人页面,非隐私页面 用router.beforeEach进行验证,这个方法必须写在router实 ...
- Jersey RESTful WebService框架学习(一)
介绍:RESTful (Representation State Transfer) 描述了一个架构样式的网络系统,比如 web 应用程序.它首次出现在 2000 年 Roy Fielding 的博士 ...
- Ubuntu Server 命令行下的默认语言改为英语en_US.UTF-8
源文链接:http://tonychiu.blog.51cto.com/656605/393131 如果Ubuntu Server在安装过程中,选择的是中文(很多新手都会在安装时选择中文,便于上手), ...
- dom4j 通过 org.dom4j.DocumentFactory 设置命名空间来支持 带namespace 的 xpath
测试文件 test.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/ ...
- mybatis sql xml 字符逃脱
where a 不等于 1 where a <> 1 where a <![CDATA[<>]]> 1