#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的更多相关文章

  1. Poj 2840 Big Clock

    1.Link: http://poj.org/problem?id=2840 2.Content: Big Clock Time Limit: 1000MS   Memory Limit: 13107 ...

  2. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  3. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

  4. POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286 ...

  5. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  6. POJ 3254. Corn Fields 状态压缩DP (入门级)

    Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Descr ...

  7. POJ 2739. Sum of Consecutive Prime Numbers

    Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20050 ...

  8. POJ 2255. Tree Recovery

    Tree Recovery Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11939   Accepted: 7493 De ...

  9. 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 ...

随机推荐

  1. 使用express框架和mongoose在MongoDB删除数据

    使用remove()删除数据 remove({},function(err,doc){})  // 删除所有数据 remove({age:18},function(err,doc){}); //删除指 ...

  2. PKG_CONFIG_PATH变量 与 ld.so.conf 文件

    一.编译和连接 一般来说,如果库的头文件不在 /usr/include 目录中,那么在编译的时候需要用 -I 参数指定其路径.由于同一个库在不同系统上可能位于不同的目录下,用户安装库的时候也可以将库安 ...

  3. Mysql正常启动之后默认使用的文件

    --basedir=/usr/local/mysql  --datadir=/usr/local/mysql/data  --plugin-dir=/usr/local/mysql/lib/plugi ...

  4. s4-6 二层交换

    为什么需要二层交换?  有很多LAN,如何将它们连接起来? 可用网桥(bridges )将它们连接起来.  网桥工作在DLL层,通过检查MAC地址做出转发帧的决策 不会检查网络层,所以,IPv ...

  5. yml的mybatis的sql查看;Mybatis+Springboot 控制台查看日志,Mybatis结合springboot打印日志

    1.配置如图 文件为yml mybatis: mapper-locations: classpath:com/springboot/transaction/mapper/*.xml configura ...

  6. mybatis-generator扩展教程系列 -- 自定义generatorConfig.xml参数

    http://blog.csdn.net/shadowsick/article/details/53413235

  7. Android: Custom View和include标签的区别

    Custom View, 使用的时候是这样的: <com.example.home.alltest.view.MyCustomView android:id="@+id/customV ...

  8. linux初学terminal命令(1)ls、cd、su、man、pwd、useradd、passwd、cat、Ctrl+C、Ctrl+Z、Ctrl+L

    terminal命令(terminal终端对应windows 按下win(linux下叫Super键)+r,输入cmd(command,命令),召唤出来的Dos控制台) 1. ls(英文list):简 ...

  9. java基础-day20

    第09天 IO流 今日内容介绍 u  File类 u  字符流与字节流 第1章   File类 1.1      File概述 打开API,搜索File类.阅读其描述:File文件和目录路径名的抽象表 ...

  10. 软件工程课堂练习&课下作业

    题目:返回一个整数数组中最大子数组的和.一.设计思路按顺序定义子数组的和,如果为负,则选下一位数为子数组的和,反之则两个相加为子数组的和.二.源代码 package test;import java. ...