#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. JSON_FORCE_OBJECT 数字索引数组 强转对象

    $abc = array('a','b','c','d','e','f','g'); echo '<pre>'; var_dump($abc); echo json_encode($abc ...

  2. main.cpp

    /*main.cpp * *The starting point of the network simulator *-Include all network header files *-initi ...

  3. java常用设计模式二:工厂模式

    1.简单工厂模式(静态工厂方法模式) 抽象实例: public interface People { void talk(); } 具体实例: public class Doctor implemen ...

  4. 分分钟搞懂rank() over(partition by)的使用

    一.rank() over(partition by ...order by) 解释:partition  by用于给结果集分组,如果没有指定那么它把整个结果集作为一个分组. 二.语法:ROW_NUM ...

  5. php7注意事项

    1. 不要使用 mysql_ 函数 这一天终于来了,从此你不仅仅“不应该”使用mysql_函数.PHP 7 已经把它们从核心中全部移除了,也就是说你需要迁移到好得多的mysqli_函数,或者更灵活的 ...

  6. Fortran编译器之一GUN Fortran安装(Windows XP)

    最近研究GIS算法,需要用到Fortran语言.在网上找了一下发现一个开源的软件GUN Fortran编译器.当然既然是编译器,就是编译出程序的,但是编辑器不包括在内.编辑器可以用Text记事本,或者 ...

  7. java基础-day12

    第01天 java面向对象 今日内容介绍 u 知识回顾 u static静态关键字 u 代码块 第1章   知识回顾 1.1      方法的回顾 1.1.1    案例代码一: package co ...

  8. STL-容器库101--array【C11】

    1. 原型 C11提供 template < class T, size_t N > class array; T: 元素类型,以 array::value_type 作为别名使用:N: ...

  9. poj 1523Tarjan算法的含义——求取割点可以分出的连通分量的个数

    poj 1523Tarjan算法的含义——求取割点可以分出的连通分量的个数 题目大意:如题目所示 给你一些关系图——连通图,想要问你有没有个节点,损坏后,可以生成几个互相独立的网络(也就是连通分量), ...

  10. verilog选择数据类型时常犯的错误

    •    信号可以分为端口信号和内部信号.出现在端口列表中的信号是端口信号,其它的信号为内部信号. •    对于端口信号,输入端口只能是net类型.输出端口可以是net类型,也可以是register ...