当前位置:网站首页>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;
}
边栏推荐
- Page generation QR code
- JS download files through URL links
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
- JS Part III
- Common plug-ins for vite project development
- 使用vscode查看Hex或UTF-8编码
- 小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
- Qt学习22 布局管理器(一)
- Uniapp skills - dom display and hiding
- Go language web development series 28: solve cross domain access of CORS with gin contrib / CORS
猜你喜欢
Current situation, analysis and prediction of information and innovation industry
Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
Common network state detection and analysis tools
[email"/>
Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email
FPGA test method takes mentor tool as an example
Go language web development series 30: gin: grouping by version for routing
Configure stylelint
[email protected] Nanoparticles) | nano metal organic framework carry"/>
Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
Failure of vector insertion element iterator in STL
JVM family - overview, program counter day1-1
随机推荐
QT learning 20 standard dialog box in QT (middle)
GoLand 2021.1.1: configure the multi line display of the tab of the open file
Go language web development series 29: Gin framework uses gin contrib / sessions library to manage sessions (based on cookies)
Conversion function and explicit
QT learning 21 standard dialog box in QT (Part 2)
Redis: operation command of string type data
Richview trvstyle liststyle list style (bullet number)
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
如何使用lxml判断网站公告是否更新
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
Uniapp skills - dom display and hiding
Example analysis of QT learning 18 login dialog box
Redis:Redis的数据结构、key的操作命令
虽然不一定最优秀,但一定是最努力的!
Global event bus
Analysis of the characteristics of page owner
Uniapp tips - scrolling components
Duet date picker (time plug-in that can manually enter the date)
Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:
Vite project commissioning