include <math.h>

2016-6-14 21:58
请先登录。
/* 说明:数组排序 姓名:周玉明 班级:7班 学号:2915015497 日期:2016/05/28 */ #include <stdio.h> #include <stdlib.h> #include <math.h> #define...
*说明:任务08-1数组排序 *姓名:原源 *班级:8班 *学号:2015015547 *日期:2016/05/26 */ #include<stdio.h> #include<stdlib.h> #include <math.h> #i...
/******************* *说明:等额本息房贷计算机 *姓名:司谨铫 *学号:356 *班级:5班 *日期:2016/3/27 ********************/ #include <math.h> #include <stdio....
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <climits>
using namespace std;

#define LS 2*i
#define RS 2*i+1
#define UP(i,x,y) for(i=x;i<=y;i++)
#define DOWN(i,x,y) for(i=x;i>=y;i--)
#define MEM(a,x) memset(a,x,sizeof(a))
#define W(a) while(a)
#define LL long long
#define N 25
#define MOD 19999997
#define INF 0x3f3f3f3f
#define EXP 1e-8

int t,hour,a,b,r,cas=1,m,s;
double minute,second;
char str[10];

void setA()
{
    if(r<=0)
        r+=360;
    minute = r/5.5;
    W(minute>=60)
    {
        hour++;
        minute-=60;
    }
    if(hour>12)
        hour-=12;
    m = (int)minute;
}

void setT()
{
    if(r>=0) r-=360;
    minute=r/5.5;
    hour--;
    W(minute<=-60)
    {
        hour--;
        minute+=60;
    }
    if(hour<=0)
        hour+=12;
    if(fabs(minute)<=EXP)
    {
        hour++;
        if(hour>12)
            hour-=12;
    }
    else minute+=60;
    m = (int)minute;
}

int main()
{
    scanf("%d",&t);
    W(t--)
    {
        scanf("%d%s%d",&a,str,&hour);
        b = 30*(12-hour);
        r = a-b;
        if(str[0]=='a')
            setA();
        else
            setT();
        second = (minute-(int)minute)*60;
        s = (int)(second+0.5);
        printf("Case %d: %d:%02d:%02d\n",cas++,hour,m,s);
    }


    return 0;
}
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <climits>
using namespace std;

#define LS 2*i
#define RS 2*i+1
#define UP(i,x,y) for(i=x;i<=y;i++)
#define DOWN(i,x,y) for(i=x;i>=y;i--)
#define MEM(a,x) memset(a,x,sizeof(a))
#define W(a) while(a)
#define LL long long
#define N 25
#define MOD 19999997
#define INF 0x3f3f3f3f
#define EXP 1e-8

int t,hour,a,b,r,cas=1,m,s;
double minute,second;
char str[10];

void setA()
{
    if(r<=0)
        r+=360;
    minute = r/5.5;
    W(minute>=60)
    {
        hour++;
        minute-=60;
    }
    if(hour>12)
        hour-=12;
    m = (int)minute;
}

void setT()
{
    if(r>=0) r-=360;
    minute=r/5.5;
    hour--;
    W(minute<=-60)
    {
        hour--;
        minute+=60;
    }
    if(hour<=0)
        hour+=12;
    if(fabs(minute)<=EXP)
    {
        hour++;
        if(hour>12)
            hour-=12;
    }
    else minute+=60;
    m = (int)minute;
}

int main()
{
    scanf("%d",&t);
    W(t--)
    {
        scanf("%d%s%d",&a,str,&hour);
        b = 30*(12-hour);
        r = a-b;
        if(str[0]=='a')
            setA();
        else
            setT();
        second = (minute-(int)minute)*60;
        s = (int)(second+0.5);
        printf("Case %d: %d:%02d:%02d\n",cas++,hour,m,s);
    }


    return 0;
}