include <string.h>
2016-5-30 21:25
请先登录。
/*姓名:韩聪聪
班级:五班
学号:2015015371
日期:2016/5/2
说明:字符串连接*/
#include <stdio.h>
#include <time.h>
#include <string.h>
#include &...
/*姓名:韩聪聪
班级:五班
学号:2015015371
日期:2016/5/2
说明:合并*/
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <...
/*姓名:韩聪聪
班级:五班
学号:2015015371
日期:2016/5/2
说明:转置*/
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <...
/*
说明:根据流程图写程序
姓名:周玉明
班级:7班
学号:2915015497
日期:2016/05/02
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#...
#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; }