poj 2840

简介:

一道很简单的数学题,直接上代码:

#include <iostream>
using namespace std;

int main()
{
    int T,hour,minute;
    cin>>T;
    while (T--)
    {
        scanf("%d",&hour);
        getchar();
        scanf("%d",&minute);

        if(minute>0)
        {
            cout<<"0"<<endl;
            continue;
        }

        if(hour<=12)
            cout<<(hour+12)<<endl;

        else
            cout<<(hour-12)<<endl;
    }

    return 0;
}
相关文章
|
9月前
|
算法 数据建模
Poj 3169(差分约束系统)
Poj 3169(差分约束系统)
39 0
|
算法框架/工具
POJ 2262 Goldbach's Conjecture
POJ 2262 Goldbach's Conjecture
150 0
|
人工智能 算法 BI
poj 2192 Zipper
题目链接:http://poj.org/problem?id=2192 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18658   Accepted: 6651 Description Given ...
987 0
|
测试技术
POJ 1001
此题用最朴素的思路实现即可,需模拟加法器,乘法器,最烦人的地方是特殊情形,如末位是小数点(12.^2=144,取小数点),整数末位是0(100^2=10000),0次幂,测试用例可能超出题目中说的范围,可能包含0次幂(100.0^0=0, 0.10^1=0.1)。
763 0
poj 3664
http://poj.org/problem?id=3664 进行两轮选举,第一轮选前n进入第二轮,第二轮选最高   #include #include using namespace std; struct vote { int a,b; int c; ...
745 0
poj-1006-Biorhythms
Description 人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。
631 0
POJ-1003-hangover
Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length.
774 0
|
人工智能 vr&ar

热门文章

最新文章