当前位置:网站首页>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.7sample 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;
}边栏推荐
- Write a jison parser from scratch (5/10): a brief introduction to the working principle of jison parser syntax
- El Table Radio select and hide the select all box
- QTreeView+自定义Model实现示例
- 2022-2028 research and trend analysis report on the global edible essence industry
- Four common methods of copying object attributes (summarize the highest efficiency)
- 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
- `Example of mask ` tool use
- Lauchpad X | 模式
- Regular expression (I)
- Hands on deep learning (33) -- style transfer
猜你喜欢

Four common methods of copying object attributes (summarize the highest efficiency)

Logstack configuration details -- elasticstack (elk) work notes 020

Daughter love: frequency spectrum analysis of a piece of music

Latex download installation record

H5 audio tag custom style modification and adding playback control events

C语言指针面试题——第二弹

Hands on deep learning (36) -- language model and data set

法向量点云旋转

2022-2028 global industry research and trend analysis report on anterior segment and fundus OTC detectors

Hands on deep learning (39) -- gating cycle unit Gru
随机推荐
Go context 基本介绍
直方图均衡化
Global and Chinese markets of hemoglobin analyzers in care points 2022-2028: Research Report on technology, participants, trends, market size and share
Report on the development trend and prospect trend of high purity zinc antimonide market in the world and China Ⓕ 2022 ~ 2027
ASP. Net to access directory files outside the project website
Deadlock in channel
Write a jison parser (7/10) from scratch: the iterative development process of the parser generator 'parser generator'
Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310
Global and Chinese markets of water heaters in Saudi Arabia 2022-2028: Research Report on technology, participants, trends, market size and share
The child container margin top acts on the parent container
Hands on deep learning (41) -- Deep recurrent neural network (deep RNN)
Trees and graphs (traversal)
Machine learning -- neural network (IV): BP neural network
Rules for using init in golang
2022-2028 global strain gauge pressure sensor industry research and trend analysis report
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
Web端自动化测试失败原因汇总
How to display √ 2 on the command line terminal ̅? This is actually a blog's Unicode test article
el-table单选并隐藏全选框
Svg image quoted from CodeChina