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;
}
相关文章
|
4月前
Hopscotch(POJ-3050)
Hopscotch(POJ-3050)
POJ 1012 Joseph
Joseph Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 53862   Accepted: 20551 Description The Joseph's problem is notoriously known.
832 0
poj-2551-ones
Description Given any integer 0
767 0
|
机器学习/深度学习
|
人工智能 vr&ar
|
机器学习/深度学习
|
算法 计算机视觉
最小割-poj-2914
poj-2914-Minimum Cut Description Given an undirected graph, in which two vertices can be connected by multiple edges, what is the size of the minimum cut of the graph? i.e. how many edges must b
1552 0