当前位置:网站首页>Exercise 9-3 plane vector addition
Exercise 9-3 plane vector addition
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
exercises 9-3 Plane vector addition (15 branch )
This question requires the preparation of procedures , Calculate the sum of two two-dimensional plane vectors .
Input format :
Type in a line and press “x1 y1 x2 y2” The format gives two two two-dimensional plane vectors v1=(x1,y1) and v2=(x2,y2) Components of .
Output format :
In a row, press (x, y) Format output and vector , The coordinates are output to one digit after the decimal point ( Note that... Cannot be output −0.0).
sample input :
3.5 -2.7 -13.9 8.7
sample output :
(-10.4, 6.0)Code
#include<stdio.h>
int main(){
double x1,x2,y1,y2,x,y;
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
x=x1+x2;
y=y1+y2;
if(x>-0.05&&x<0){
x=0;
}else if(y>-0.05&&y<0){
y=0;
}
printf("(%.1lf, %.1lf)",x,y);
return 0;
}
边栏推荐
猜你喜欢

Qt学习17 对话框及其类型
[email"/>Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email

信创产业现状、分析与预测

Richview trvstyle liststyle list style (bullet number)

Scroll detection, so that the content in the lower right corner is not displayed at the top of the page, but is displayed as the mouse slides
[email protected] (FE) | glycyrrhetinic acid modified metal organ"/>Formation of mil-100 (FE) coated small molecule aspirin [email protected] (FE) | glycyrrhetinic acid modified metal organ

28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;

MySQL 数据增删改查综合案例

MySQL data processing value addition, deletion and modification

JS first summary
随机推荐
[bw16 application] instructions for firmware burning of Anxin Ke bw16 module and development board update
selenium 浏览器(1)
The small project (servlet+jsp+mysql+el+jstl) completes a servlet with login function, with the operation of adding, deleting, modifying and querying. Realize login authentication, prevent illegal log
Implementation of Muduo accept connection, disconnection and sending data
Use and design of Muduo buffer class
GoLand 2021.1.1: configure the multi line display of the tab of the open file
FPGA测试方法以Mentor工具为例
Qt学习22 布局管理器(一)
QT learning 21 standard dialog box in QT (Part 2)
Metal organic framework (MOFs) antitumor drug carrier | pcn-223 loaded with metronidazole | uio-66 loaded with ciprofloxacin hydrochloride(
好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
MySQL 数据增删改查综合案例
Print. JS -- web page file printing
JS continues to explore...
Page generation QR code
Failure of vector insertion element iterator in STL
concat和concat_ws()区别及group_concat()和repeat()函数的使用
Go 1.16.4: manage third-party libraries with Mod
怎样删除对象的某个属性或⽅法
[acnoi2022] guess numbers