当前位置:网站首页>Exercise 9-3 plane vector addition (15 points)
Exercise 9-3 plane vector addition (15 points)
2022-07-04 09:46:00 【skeet follower】
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)
The code is as follows :
#include<stdio.h>
int main()
{
double x1,y1,x2,y2;
scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
double x=x1+x2,y=y1+y2;
if(x>-0.05&&x<0){
x=0.0;
}
if(y>-0.05&&y<0){
y=0.0;
}
printf("(%.1f, %.1f)",x,y);
return 0;
}
边栏推荐
- 2022-2028 global small batch batch batch furnace industry research and trend analysis report
- Sort out the power node, Mr. Wang he's SSM integration steps
- Analysis report on the development status and investment planning of China's modular power supply industry Ⓠ 2022 ~ 2028
- 自动化的优点有哪些?
- Hands on deep learning (44) -- seq2seq principle and Implementation
- Fatal error in golang: concurrent map writes
- 查看CSDN个人资源下载明细
- MySQL transaction mvcc principle
- Daughter love in lunch box
- 2022-2028 global gasket plate heat exchanger industry research and trend analysis report
猜你喜欢
Hands on deep learning (38) -- realize RNN from scratch
Hands on deep learning (41) -- Deep recurrent neural network (deep RNN)
2022-2028 global optical transparency industry research and trend analysis report
Fabric of kubernetes CNI plug-in
Daughter love in lunch box
Hands on deep learning (35) -- text preprocessing (NLP)
H5 audio tag custom style modification and adding playback control events
Summary of reasons for web side automation test failure
2022-2028 global seeder industry research and trend analysis report
Summary of small program performance optimization practice
随机推荐
H5 audio tag custom style modification and adding playback control events
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
Luogu deep foundation part 1 Introduction to language Chapter 4 loop structure programming (2022.02.14)
Hands on deep learning (45) -- bundle search
Mmclassification annotation file generation
How web pages interact with applets
Basic data types in golang
百度研发三面惨遭滑铁卢:面试官一套组合拳让我当场懵逼
回复评论的sql
Pueue data migration from '0.4.0' to '0.5.0' versions
Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
Write a jison parser from scratch (2/10): learn the correct posture of the parser generator parser generator
[on February 11, 2022, the latest and most fully available script library collection of the whole network, a total of 23]
Are there any principal guaranteed financial products in 2022?
PHP is used to add, modify and delete movie information, which is divided into foreground management and background management. Foreground users can browse information and post messages, and backgroun
2022-2028 global optical transparency industry research and trend analysis report
`Example of mask ` tool use
Hands on deep learning (39) -- gating cycle unit Gru
How do microservices aggregate API documents? This wave of show~
Summary of reasons for web side automation test failure