杭电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 ...
随机推荐
- Understanding page frames and pages
Memory in Linux is organized in the form of pages (typically 4 KB in size). Contiguous linear addres ...
- NSNotificationCenter通知中心
概述 NSNotificationCenter通知中心,通常用于一对一或者一对多的消息传递,即当一个地方改变时,要求改变其他的一些地方,例如当网络请求回来了新的数据,需要刷新本地信息和本地内存里面的界 ...
- 约瑟夫环问题及python与c++实现效率对比
约瑟夫环是一个数学的应用问题:已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围.从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重 ...
- 【PHP代码审计】 那些年我们一起挖掘SQL注入 - 3.全局防护Bypass之Base64Decode
0x01 背景 现在的WEB程序基本都有对SQL注入的全局过滤,像PHP开启了GPC或者在全局文件common.php上使用addslashes()函数对接收的参数进行过滤,尤其是单引号.同上一篇,我 ...
- c++ 设计模式9 (Abstract Factory 抽象工厂模式)
5.2 抽象工厂模式 动机:在软件系统中,经常面临着“一系列相互依赖的对象”的创建工作:同时,由于需求的变化,往往存在更多系列对象的创建工作. 代码示例: 实现利用数据库的业务逻辑,支持多数据库(Sq ...
- sql server 中将由逗号“,”分割的一个字符串,转换为一个表,并应用与 in 条件
,,) 这样的语句和常用,但是如果in 后面的 1,2,3是变量怎么办呢,一般会用字符串连接的方式构造sql语句 string aa="1,2,3"; string sqltxt= ...
- 1.5 理解Analyzers,Tokenizers,Filters--目录
这部分介绍了solr如何分解和处理文本数据的,它包含一下主题: 1.5.1 Analyzers,Tokenizers,Filters概述:主要介绍Analyzers,Tokenizers,Filter ...
- 开启AsyncTask从网络加载图片
/*AsyncTask 异步任务即做一些简单的异步处理 :是handle与线程池的封装 * 第一个泛型:参数类型泛型 * 第二个泛型:更新进度泛型 * 第三个泛型:onProgressUpdate的返 ...
- iOS 自定义 shareSDK 容器
- (void)initializePlat { //添加新浪微博应用 [ShareSDK connectSinaWeiboWithAppKey:@"3201194191" app ...
- [Java] JAVA程序员您需要学习的25个标准
(1) 你需要精通面向对象分析与设计(OOA/OOD).涉及模式(GOF,J2EEDP)以及综合模式.你应该了解UML,尤其是class,object,interaction以 及statediagr ...