改章节个人在青岛吃饭的时候突然想到的...这几周就有想写几篇关于单位null的笔记,所以回家到之后就奋笔疾书的写出来发布了
http://acm.hdu.edu.cn/showproblem.php?pid=2076
按照不同单位转一圈,然后转换成某一个同一的单位换算即可
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "math.h"
#include "algorithm"
#include "iostream"
using namespace std;
int main()
{
int n , h , m , s ;
double ans1 , ans2 , temp ;
scanf( "%d" , &n ) ;
int t ;
while( n-- )
{
scanf( "%d%d%d" ,&h , &m , &s ) ;
ans1 = 1.0 * m * 6 + 0.1 * s ;
ans2 = 1.0 * ( h % 12 ) * 30 + 0.5 * m + 1.0 / 120 * s ;
temp = fabs( ans1 - ans2 ) ;
if( temp > 180 )
t = (int )(360 - temp) ;
else
t = (int)temp ;
printf( "%d\n" ,t );
}
return 0;
}
文章结束给大家分享下程序员的一些笑话语录: 这个世界上只有10种人:懂得二进制的和不懂得二进制的。
--------------------------------- 原创文章 By 单位和null ---------------------------------