杭电ACM2076--夹角有多大(题目已修改,注意读题)

http://acm.hdu.edu.cn/showproblem.php?pid=2076

思路很简单。直接贴代码。过程分析有点耗时间。

// #include <stdio.h>
// #include <math.h>
// int main()
// {
// int t;
// double h,m,s;
// //int h,m,s;
// int z;
// scanf("%d",&t);
// while (t--)
// {
// z = 0;
// scanf("%lf%lf%lf",&h,&m,&s);
// //scanf("%d%d%d",&h,&m,&s);
// //printf("asdf");
//
// z = (int)((h+(m+s/60)/60)*360/12-((m+s/60)*360/60)-0.5);
// if (z<0)
// {
// z = -z;
// }
// else if (z>180)
// {
// z = 360-z;
// }
// printf("%d\n",z);
// }
// return 0;
// } /*
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
//#include<map>
#include<sstream>
#include<set>
#include<queue>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x3fffffff
using namespace std;
const double pi = acos(-1.);
int a[100010];
int main()
{
int t;
while(~scanf("%d",&t))
{
while(t--)
{
int h,s,m;
double ans1,ans2;
scanf("%d%d%d",&h,&m,&s);
if(h>=12) h-=12;
ans1=(h+(m*1.0/60)+(s*1.0/3600))*30;//先算时针夹角
ans2=(m+(s*1.0/60))*6;//再算分针
if(fabs(ans1-ans2)>180)
{
printf("%d\n",int(360-(fabs(ans1-ans2))));
}
else
{
printf("%d\n",int(fabs(ans1-ans2)));
}
}
}
return 0;
}
*/ #include <stdio.h>
#include <math.h>
int main()
{
int t;
int h,s,m;
double ans1,ans2;
scanf("%d",&t);
while (t--)
{
scanf("%d%d%d",&h,&m,&s);
if (h>=) h = h-;
ans1 = (h+(m*1.0/)+(s*1.0/))*;
ans2 = (m+(s*1.0/))*;
if(fabs(ans1-ans2)>)
{
printf("%d\n",int(-(fabs(ans1-ans2))));
}
else
{
printf("%d\n",int(fabs(ans1-ans2)));
}
}
}

杭电ACM2076--夹角有多大(题目已修改,注意读题)的更多相关文章

  1. HDOJ 2076 夹角有多大(题目已修改,注意读题)

    Problem Description 时间过的好快,一个学期就这么的过去了,xhd在傻傻的看着表,出于对数据的渴望,突然他想知道这个表的时针和分针的夹角是多少.现在xhd知道的只有时间,请你帮他算出 ...

  2. HDU 2076 夹角有多大(题目已修改,注意读题)

    Problem Description 时间过的好快,一个学期就这么的过去了,xhd在傻傻的看着表,出于对数据的渴望,突然他想知道这个表的时针和分针的夹角是多少.现在xhd知道的只有时间,请你帮他算出 ...

  3. HDUOJ--2079选课时间(题目已修改,注意读题)

    选课时间(题目已修改,注意读题) Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  4. hdu 2079 选课时间(题目已修改,注意读题)

    http://acm.hdu.edu.cn/showproblem.php?pid=2079 背包 #include <cstdio> #include <cstring> # ...

  5. hdu2079 选课时间(题目已修改,注意读题) 母函数

    计算数的和的种类,母函数裸题 #include<stdio.h> #include<string.h> ],c2[],a,b; int main(){ int T; while ...

  6. hdu 2079 选课时间(题目已改动,注意读题) (母函数)

    代码: #include<cstdio> #include<cstring> using namespace std; int main() { int t; scanf(&q ...

  7. 杭电ACM2080--夹角有多大II

    http://acm.hdu.edu.cn/showproblem.php?pid=2080 /* //Author:nunu // #include <stdio.h> #include ...

  8. HDU 2076 夹角有多大

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2076 夹角有多大(题目已修改,注意读题) Time Limit: 1000/1000 MS (Java ...

  9. 杭电oj2064、2067、2068、2073、2076-2078、2080、2083-2085

    2064  汉诺塔III #include<stdio.h> int main(){ int n,i; _int64 s[]; while(~scanf("%d",&a ...

随机推荐

  1. MySQL 5.7.12新增MySQL Shell命令行功能

      在最新发布的MySQL 5.7.12中有许多令人兴奋的新功能,对于MySQL开发者来说,最令人兴奋的莫不是新增的MySQL Shell了,其下载地址: http://dev.mysql.com/d ...

  2. 终端I/O之特殊输入字符

    POSIX.1定义了11个在输入时作特殊处理的字符.实现定义了另外一些特殊字符.表18-6摘要列出了这些特殊字符. 表18-6 终端特殊输入字符 在POSIX.1的11个特殊字符中,可将其中9个更改为 ...

  3. Qt界面美化 QSS

    目前发现在Qt-Design中右击控件,可以选择Change StyleSheet ------------------------以下总结不太对 刚接触Qt,发现Qt Design无法对每个控件进行 ...

  4. 在应用程序中实现对NandFlash的操作

    以TC58NVG2S3ETA00 为例: 下面是它的一些物理参数: 图一 图二 图三 图四 图五 图6-0 图6-1 说明一下,在图6-1中中间的那个布局表可以看做是实际的NandFlash一页数据的 ...

  5. 【Shell脚本学习2】Shell脚本语言与编译型语言的差异

    大体上,可以将程序设计语言可以分为两类:编译型语言和解释型语言. 编译型语言 很多传统的程序设计语言,例如Fortran.Ada.Pascal.C.C++和Java,都是编译型语言.这类语言需要预先将 ...

  6. Android的Task和Activity相关

    android:allowTaskReparenting    用来标记Activity能否从启动的Task移动到有着affinity的Task(当这个Task进入到前台时)——“true”,表示能移 ...

  7. ajax 请求

    案例: <html><head><script type="text/javascript">function loadXMLDoc(){var ...

  8. mysql简单介绍

    SQL语言分为三个部分:数据定义语言( Data DefinitionLanguage,简称为DDL).数据操作语言( DataManipulation Language,简称为DML)和数据控制语言 ...

  9. Freebsd 下如何最有效率的安装软件

    FreeBSD的默认下载工具是fetch,既慢又不好用.在FreeBSD下安装软件有一些很有效率的方式,下面就给大家介绍一下. Ports机制 首先,FreeBSD下最有特色的软件安装和升级机制就是p ...

  10. ASP.NET多线程下使用HttpContext.Current

    本来要实现asp.net下使用tcp通讯方式向服务器获取数据,开始采用的方式是 参考: ASP.NET多线程下使用HttpContext.Current为null解决方案 http://www.cnb ...