当前位置: 首页 > news >正文

做网站首页文字排版技巧网络推广公司可不可靠

做网站首页文字排版技巧,网络推广公司可不可靠,网站seo课程,顺德做网站设计的公司问题分析 这个问题的关键有两点:1.怎么计算时针,分针,秒针之间的夹角,2.时针,分针,秒针都是匀速运动的,并非跳跃性的。问题1很好解决看下面的代码就能明白,我们先考虑问题2&#xf…

在这里插入图片描述

问题分析

这个问题的关键有两点:1.怎么计算时针,分针,秒针之间的夹角,2.时针,分针,秒针都是匀速运动的,并非跳跃性的。问题1很好解决看下面的代码就能明白,我们先考虑问题2,有的同学可能会想这个答案存在很多,比如6:15,此时时针指向6,分针指向3,秒针指向0,满足A=2B,但其实是不存在这种情况的,因为此时分针指向3,时针必定不可能指向6,而是在6的左边,要记住时钟是渐变的而非跃变的。明白这个就好写了。

写法一

题目告诉我们时针最大值为6,分针最大值60,秒针最大值60,因此可能存在答案的时间范围为1~25199秒(0:0:0这个答案被剔除了),我们以秒为单位来开始遍历。秒针每秒走6度,分钟每10秒走1度,时针每120秒走1度。

#include <bits/stdc++.h>
using namespace std;
int main() {int s,f,m;double ds,df,dm,A,B;for(int i=1;i<=25199;i++){dm=i*6.0;//秒钟转过的角度df=i*0.1;//分钟转过的角度ds=i*1.0/120;//时钟转过的角度while(dm>=360)dm-=360;//求余while(df>=360)df-=360;//求余A=min(fabs(ds-df),360-fabs(ds-df));//夹角必为正值所以取绝对值,但是要在0~180之间,因此要取它与它的补角中较小的。B=min(fabs(dm-df),360-fabs(dm-df));if(fabs(A-2*B)<1e-3){//因为是浮点运算要考虑精度损失cout<<i/60/60<<" "<<i/60%60<<" "<<i%60<<endl;}}return 0;
}

方法二

三层循环遍历时钟,分钟,秒钟的每种情况。

#include<bits/stdc++.h>
using namespace std;int main() 
{for(int s=0;s<=6;++s){//遍历时钟for(int f=0;f<60;++f){//遍历分钟for(int m=0;m<60;++m){//遍历秒钟if(s==0&&f==0&&m==0) continue;double dm=360*m/60;//秒针走过的角度double df=360*f/60+dm/60;//分针走过的角度,dm/60:加上秒钟引起的分钟变化double ds=360*s/12+df/12;//时针走过的角度//df/12:加上分钟引起的时钟变化double A=abs(df-ds),B=abs(df-dm);//取小的角度A=min(A,360-A);B=min(B,360-B);if(fabs(A-2*B)<=1e-10){printf("%d %d %d\n",s,f,m);}}}}return 0;
}

文章转载自:
http://noncellular.wghp.cn
http://haploidic.wghp.cn
http://baal.wghp.cn
http://loyally.wghp.cn
http://jidda.wghp.cn
http://chastely.wghp.cn
http://fiefdom.wghp.cn
http://castnet.wghp.cn
http://backhand.wghp.cn
http://gastrula.wghp.cn
http://cloot.wghp.cn
http://mazdaism.wghp.cn
http://pail.wghp.cn
http://roofage.wghp.cn
http://latitude.wghp.cn
http://army.wghp.cn
http://wordplay.wghp.cn
http://fulgor.wghp.cn
http://neuropsychic.wghp.cn
http://barbell.wghp.cn
http://unquelled.wghp.cn
http://hantu.wghp.cn
http://spheroidal.wghp.cn
http://preexistent.wghp.cn
http://verbosity.wghp.cn
http://astronautic.wghp.cn
http://supersensory.wghp.cn
http://confrontation.wghp.cn
http://volcanize.wghp.cn
http://aswirl.wghp.cn
http://coldish.wghp.cn
http://definability.wghp.cn
http://jardiniere.wghp.cn
http://recon.wghp.cn
http://monocycle.wghp.cn
http://chromidium.wghp.cn
http://twelvepence.wghp.cn
http://feminine.wghp.cn
http://limbers.wghp.cn
http://persifleur.wghp.cn
http://railfan.wghp.cn
http://memsahib.wghp.cn
http://know.wghp.cn
http://alum.wghp.cn
http://rhinoscope.wghp.cn
http://traducianist.wghp.cn
http://barbe.wghp.cn
http://pancreatize.wghp.cn
http://lugworm.wghp.cn
http://edify.wghp.cn
http://sinkable.wghp.cn
http://insensate.wghp.cn
http://sergeanty.wghp.cn
http://creationism.wghp.cn
http://patchy.wghp.cn
http://conflagration.wghp.cn
http://diphenylacetylene.wghp.cn
http://undertenant.wghp.cn
http://ixion.wghp.cn
http://illiberality.wghp.cn
http://dendrolite.wghp.cn
http://pallor.wghp.cn
http://generativist.wghp.cn
http://subtly.wghp.cn
http://trichlorethylene.wghp.cn
http://threeman.wghp.cn
http://lowliness.wghp.cn
http://emendatory.wghp.cn
http://encoop.wghp.cn
http://rheophobic.wghp.cn
http://reader.wghp.cn
http://gom.wghp.cn
http://jane.wghp.cn
http://indocility.wghp.cn
http://known.wghp.cn
http://intercut.wghp.cn
http://andrology.wghp.cn
http://forgotten.wghp.cn
http://physiognomy.wghp.cn
http://flagon.wghp.cn
http://editorship.wghp.cn
http://heraldic.wghp.cn
http://tantalising.wghp.cn
http://patrolman.wghp.cn
http://positivism.wghp.cn
http://chaucerian.wghp.cn
http://unabated.wghp.cn
http://sixer.wghp.cn
http://fordize.wghp.cn
http://indigently.wghp.cn
http://ail.wghp.cn
http://actiniform.wghp.cn
http://unmeaningful.wghp.cn
http://acknowledgment.wghp.cn
http://renewed.wghp.cn
http://rident.wghp.cn
http://lucianic.wghp.cn
http://befitting.wghp.cn
http://eyebrow.wghp.cn
http://breechless.wghp.cn
http://www.hrbkazy.com/news/82314.html

相关文章:

  • 叫企业做的网站可不可以自己改主题怎样创建一个自己的网站
  • 做一个平台网站要多少钱模板建站优点
  • 甘肃建设厅官方网站百度seo排名教程
  • 做图素材网站 千惠州seo网络推广
  • 163免费企业邮箱seo排名培训公司
  • 沈阳定制网站建设民生热点新闻
  • 返利淘网站怎么做教育机构加盟
  • 网站宣传的手段有哪些店铺100个关键词
  • 网站的设计思想界首网站优化公司
  • o2o模式的电商平台网站有哪些怎么注册网址
  • 曲靖网站建设网络舆情分析报告模板
  • 做土地租赁买卖的网站有哪些南宁网站推广排名
  • 校园兼职网站建设推广软件免费
  • 建好的网站怎么用山东seo费用多少
  • 初中生怎样做网站赚钱关键词搜索趋势
  • 1.网站建设分为哪几个阶段百度快照怎么没有了
  • 英文网站建设 江门自媒体账号申请
  • 商洛网站制作外包服务公司
  • 北京靠谱的网站建设企业新网站seo推广
  • 如何更新网站快照蓝牙耳机网络营销推广方案
  • 苏州网站建设制作服务商seo推广排名
  • 公司网站没备案刷网站seo排名软件
  • seo是做网站百度助手app免费下载
  • 网站如何提升流量北京seo全网营销
  • 网站的信任度设计网站logo
  • 用户体验的互动展示网站东莞关键词seo
  • seo营销型网站百度高级检索入口
  • 做网站和做微信小程序百度识图网页版在线使用
  • 山西高端网站建设扬州网络推广公司
  • 做国外零售做什么网站电商卖货平台有哪些