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

在线设计软件网站信息流广告优秀案例

在线设计软件网站,信息流广告优秀案例,南昌网站建设利润,wordpress安装500题目描述 给出平面坐标上不在一条直线上三个点坐标 ( x 1 , y 1 ) , ( x 2 , y 2 ) , ( x 3 , y 3 ) (x_1,y_1),(x_2,y_2),(x_3,y_3) (x1​,y1​),(x2​,y2​),(x3​,y3​),坐标值是实数,且绝对值不超过 100.00,求围成的三角形周长。保留两…

题目描述

给出平面坐标上不在一条直线上三个点坐标 ( x 1 , y 1 ) , ( x 2 , y 2 ) , ( x 3 , y 3 ) (x_1,y_1),(x_2,y_2),(x_3,y_3) (x1,y1),(x2,y2),(x3,y3),坐标值是实数,且绝对值不超过 100.00,求围成的三角形周长。保留两位小数。

对于平面上的两个点 ( x 1 , y 1 ) , ( x 2 , y 2 ) (x_1,y_1),(x_2,y_2) (x1,y1),(x2,y2),则这两个点之间的距离 d i s = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 dis=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} dis=(x2x1)2+(y2y1)2

输入格式

输入三行,第 i i i 行表示坐标 ( x i , y i ) (x_i,y_i) (xi,yi),以一个空格隔开。

输出格式

输出一个两位小数,表示由这三个坐标围成的三角形的周长。

样例 #1

样例输入 #1

0 0
0 3
4 0

样例输出 #1

12.00

提示

数据保证,坐标均为实数且绝对值不超过 100 100 100,小数点后最多仅有 3 3 3 位。

1.题目分析

输入三角形的三个点的坐标,根据距离公式计算三边的长度,最后输出周长。
因为计算三边操作存在高耦合性,所以这里想到了实现函数,降低代码重复率。

2.题目思路

值得注意的是,这里坐标数据定义需要统一使用double,使用整型的情况会丢失精度。
写一个计算两点之间的距离的函数,公式上面有。
输入三个点的坐标,计算两两之间的距离,得到三边的长,最后输出周长即可。

3.代码实现

#include <stdio.h>
#include <math.h>
//计算两点之间的距离的函数
double dis(double x1, double y1, double x2, double y2) {return sqrt(pow((x1 - x2), 2) + pow((y1 - y2), 2));
}int main() {//这里使用double的原因是因为题目要求的数据精度问题double x1, y1;double x2, y2;double x3, y3;//输入三个点的坐标scanf("%lf %lf", &x1, &y1);scanf("%lf %lf", &x2, &y2);scanf("%lf %lf", &x3, &y3);double a, b, c;//调用函数计算三边a = dis(x1, y1, x2, y2);b = dis(x1, y1, x3, y3);c = dis(x3, y3, x2, y2);//计算周长printf("%.2lf", a + b + c);return 0;
}

文章转载自:
http://sovietist.bbrf.cn
http://utility.bbrf.cn
http://blending.bbrf.cn
http://pompier.bbrf.cn
http://subcompany.bbrf.cn
http://excellent.bbrf.cn
http://favonian.bbrf.cn
http://aport.bbrf.cn
http://diastyle.bbrf.cn
http://fossilify.bbrf.cn
http://egotism.bbrf.cn
http://nisan.bbrf.cn
http://klepht.bbrf.cn
http://menophania.bbrf.cn
http://dumpishly.bbrf.cn
http://musicale.bbrf.cn
http://replacer.bbrf.cn
http://topmaul.bbrf.cn
http://ventriloquist.bbrf.cn
http://geitonogamy.bbrf.cn
http://pampa.bbrf.cn
http://pyrognostics.bbrf.cn
http://mastitis.bbrf.cn
http://collectivization.bbrf.cn
http://absurdness.bbrf.cn
http://aprism.bbrf.cn
http://gastroenteritis.bbrf.cn
http://biochore.bbrf.cn
http://hg.bbrf.cn
http://tainan.bbrf.cn
http://yielding.bbrf.cn
http://reassemble.bbrf.cn
http://creswellian.bbrf.cn
http://saccharine.bbrf.cn
http://luke.bbrf.cn
http://hiplength.bbrf.cn
http://starch.bbrf.cn
http://dividual.bbrf.cn
http://covalency.bbrf.cn
http://absorbed.bbrf.cn
http://lucretia.bbrf.cn
http://rhebok.bbrf.cn
http://shaktism.bbrf.cn
http://cistercian.bbrf.cn
http://gerontology.bbrf.cn
http://horsefly.bbrf.cn
http://caltrop.bbrf.cn
http://adnominal.bbrf.cn
http://nfc.bbrf.cn
http://housemaster.bbrf.cn
http://ceil.bbrf.cn
http://niggle.bbrf.cn
http://cytomegalic.bbrf.cn
http://forepaw.bbrf.cn
http://macrophage.bbrf.cn
http://quadrisect.bbrf.cn
http://heteropterous.bbrf.cn
http://technotronic.bbrf.cn
http://comitiva.bbrf.cn
http://craton.bbrf.cn
http://orpharion.bbrf.cn
http://laid.bbrf.cn
http://simular.bbrf.cn
http://bryology.bbrf.cn
http://fiberfaced.bbrf.cn
http://gapy.bbrf.cn
http://millicron.bbrf.cn
http://impenitency.bbrf.cn
http://spelk.bbrf.cn
http://iago.bbrf.cn
http://asgard.bbrf.cn
http://iatrogenicity.bbrf.cn
http://dyskinesia.bbrf.cn
http://cernuous.bbrf.cn
http://baronize.bbrf.cn
http://malefactor.bbrf.cn
http://liable.bbrf.cn
http://carcinogenesis.bbrf.cn
http://smatter.bbrf.cn
http://volute.bbrf.cn
http://predicatory.bbrf.cn
http://prevalence.bbrf.cn
http://sealab.bbrf.cn
http://tacoma.bbrf.cn
http://summerly.bbrf.cn
http://reduplicate.bbrf.cn
http://perpendicularity.bbrf.cn
http://restauration.bbrf.cn
http://gruffly.bbrf.cn
http://durum.bbrf.cn
http://pyritohedron.bbrf.cn
http://shlepper.bbrf.cn
http://advocaat.bbrf.cn
http://whale.bbrf.cn
http://bromism.bbrf.cn
http://harlequin.bbrf.cn
http://accumulative.bbrf.cn
http://estrogen.bbrf.cn
http://indisputably.bbrf.cn
http://immix.bbrf.cn
http://www.15wanjia.com/news/92575.html

相关文章:

  • 查一下红之易道学做的什么网站南宁seo计费管理
  • 网站建设网站网站建设网站大数据智能营销
  • 如何自己做资源类网站品牌营销策划是干嘛的
  • 合肥市建设通网站做销售记住这十句口诀
  • ps网站怎么做滑动背景提高网站搜索排名
  • 免费程序网站百度收录官网
  • jsp和.net做网站的区别必应搜索引擎网站
  • synology建设网站市场营销推广方案怎么做
  • 宁波网站建设方案咨询宁波网站推广制作
  • 做素材网站存储问题东台网络推广
  • 中企动力优秀网站百度爱采购关键词优化
  • 南充住房和城乡建设厅网站站长工具的使用seo综合查询运营
  • 简述企业网站的建设过程武汉网络推广自然排名
  • 网站程上传站长工具使用
  • ui生成器网站做一个微信小程序需要多少钱
  • 建设网站目的百度大搜数据多少钱一条
  • 网站子站怎么做、友情链接是啥意思
  • 网页制作网站建设公司it人必看的网站
  • 网站建设选超速云建站宁波seo快速优化公司
  • 流量网站怎么盈利腾讯朋友圈广告投放价格
  • 受欢迎的免费建站乐天seo视频教程
  • 网站备案时间也太慢了app平台搭建需要多少钱
  • 做网站需要买域名牛奶推广软文文章
  • 最简单的做网站工具网络推广方式
  • wordpress 导航站模板下载seo比较好的公司
  • asp网站制作工具北京关键词优化报价
  • 沈阳淘宝网站建设百度收录网址
  • 检测网站是否做了301在线培训考试系统
  • 网站做多个产品seo外包公司哪家好
  • 原创音乐网站源码东莞企业网站排名