杭电ACM2076--夹角有多大(题目已修改,注意读题)
杭电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--夹角有多大(题目已修改,注意读题)的更多相关文章
- HDOJ 2076 夹角有多大(题目已修改,注意读题)
Problem Description 时间过的好快,一个学期就这么的过去了,xhd在傻傻的看着表,出于对数据的渴望,突然他想知道这个表的时针和分针的夹角是多少.现在xhd知道的只有时间,请你帮他算出 ...
- HDU 2076 夹角有多大(题目已修改,注意读题)
Problem Description 时间过的好快,一个学期就这么的过去了,xhd在傻傻的看着表,出于对数据的渴望,突然他想知道这个表的时针和分针的夹角是多少.现在xhd知道的只有时间,请你帮他算出 ...
- HDUOJ--2079选课时间(题目已修改,注意读题)
选课时间(题目已修改,注意读题) Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- hdu 2079 选课时间(题目已修改,注意读题)
http://acm.hdu.edu.cn/showproblem.php?pid=2079 背包 #include <cstdio> #include <cstring> # ...
- hdu2079 选课时间(题目已修改,注意读题) 母函数
计算数的和的种类,母函数裸题 #include<stdio.h> #include<string.h> ],c2[],a,b; int main(){ int T; while ...
- hdu 2079 选课时间(题目已改动,注意读题) (母函数)
代码: #include<cstdio> #include<cstring> using namespace std; int main() { int t; scanf(&q ...
- 杭电ACM2080--夹角有多大II
http://acm.hdu.edu.cn/showproblem.php?pid=2080 /* //Author:nunu // #include <stdio.h> #include ...
- HDU 2076 夹角有多大
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2076 夹角有多大(题目已修改,注意读题) Time Limit: 1000/1000 MS (Java ...
- 杭电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 ...
随机推荐
- 0c-41-ARC下循环引用问题
1.ARC下循环引入问题 一个人拥有一只狗,一只狗拥有一个主人. 当增加d.owner = p;时形成循环引用. 解决方法:一端用strong,一端用weak. 2.ARC下@property参数 A ...
- android学习日记13--数据存储之ContentProvide
3.ContentProvider 数据在Android当中是私有的,当然这些数据包括文件数据和数据库数据以及一些其他类型的数据.ContentProvider实现多应用程序间的数据共享类一般利用Co ...
- 使用 satis 搭建一个私有的 Composer 包仓库
在我们的日常php开发中可能需要使用大量的composer包,大部份都可以直接使用,但在公司内部总有一小部份包是不能公开的,这时候我们就需要搭建一个公司内部使用的composer仓库,好在compos ...
- C#中的多态现象
面向对象的特征封装.继承和多态.Polymorphism(多态性)来源于希腊单词,指“多种形态”.多态性的一个重要特征是方法的调用是在运行时确定而不是编译时.在.NET中用于实现多态性的关键词有vir ...
- B - Fill
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UV ...
- PN-Traniger
首先先从Bezier说起: 一条直线上有两个端点,P0和P1,那么直线可以写成 y = kx+b ,其实也就是P(t) = (1-t)P0 + P1 (这是个插值函数),(小注,我时常把这两个 ...
- 【阿里云产品公测】离线归档OAS,在也不用备份担心空间了
作者:阿里云用户 莫须有3i 1 起步 1.1 初识OAS 啥是OAS,请看官方说明: 引用 开放归档服务(Open Archive Service,简称OAS),致力于提供低成本.高可靠的数据归档服 ...
- 【Mood-3】心声
每天醒来,我都会想明白一件事情,时间是不会停下来的,如果打算活下去的话,那么我们会有25岁,会有30岁,更会有40岁,为了不让时间风干我的理想,未来只剩下抱怨,那么为明天伏笔,今天只有努力.耸耸背上行 ...
- 社交分享:-canOpenURL: failed for URL: "weixin://app/*************/" - error: "This app is not allowed to query for scheme weixin"
升级到iOS9后,微信,QQ,微博等社交软件的分享都失效了,控制台默默地打印了这条信息: This app is not allowed to query for scheme xxx 这是因为iOS ...
- asp.net中Response对象鱼Request对象
在asp.net中Response与Request对象是两个常用的对象,虽然他们长得有点像,但是作用却是截然不同,我们来看一下他们他们都有哪些不同. 一.Response对象主要作用:像浏览器输出信息 ...