当前位置:网站首页>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;
}
边栏推荐
- Investment analysis and prospect prediction report of global and Chinese high purity tin oxide Market Ⓞ 2022 ~ 2027
- SSM online examination system source code, database using mysql, online examination system, fully functional, randomly generated question bank, supporting a variety of question types, students, teache
- Baidu R & D suffered Waterloo on three sides: I was stunned by the interviewer's set of combination punches on the spot
- xxl-job惊艳的设计,怎能叫人不爱
- Matlab tips (25) competitive neural network and SOM neural network
- C # use gdi+ to add text to the picture and make the text adaptive to the rectangular area
- libmysqlclient. so. 20: cannot open shared object file: No such file or directory
- Golang Modules
- Sort out the power node, Mr. Wang he's SSM integration steps
- 2022-2028 global probiotics industry research and trend analysis report
猜你喜欢
Fabric of kubernetes CNI plug-in
PHP book borrowing management system, with complete functions, supports user foreground management and background management, and supports the latest version of PHP 7 x. Database mysql
Hands on deep learning (43) -- machine translation and its data construction
H5 audio tag custom style modification and adding playback control events
Hands on deep learning (42) -- bi-directional recurrent neural network (BI RNN)
libmysqlclient. so. 20: cannot open shared object file: No such file or directory
2022-2028 global gasket plate heat exchanger industry research and trend analysis report
Daughter love in lunch box
2022-2028 global probiotics industry research and trend analysis report
Latex download installation record
随机推荐
MySQL develops small mall management system
Analysis report on the production and marketing demand and investment forecast of tellurium dioxide in the world and China Ⓣ 2022 ~ 2027
2022-2028 global intelligent interactive tablet industry research and trend analysis report
Ultimate bug finding method - two points
华为联机对战如何提升玩家匹配成功几率
Logstack configuration details -- elasticstack (elk) work notes 020
C language pointer interview question - the second bullet
xxl-job惊艳的设计,怎能叫人不爱
Multilingual Wikipedia website source code development part II
Development trend and market demand analysis report of high purity tin chloride in the world and China Ⓔ 2022 ~ 2027
[on February 11, 2022, the latest and most fully available script library collection of the whole network, a total of 23]
Go context basic introduction
Qtreeview+ custom model implementation example
Investment analysis and prospect prediction report of global and Chinese high purity tin oxide Market Ⓞ 2022 ~ 2027
Hands on deep learning (36) -- language model and data set
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
Hands on deep learning (46) -- attention mechanism
Research Report on the development trend and Prospect of global and Chinese zinc antimonide market Ⓚ 2022 ~ 2027
Are there any principal guaranteed financial products in 2022?
Kubernetes CNI 插件之Fabric