当前位置:网站首页>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;
}边栏推荐
- Global and Chinese PCB function test scale analysis and development prospect planning report Ⓑ 2022 ~ 2027
- Golang defer
- Deadlock in channel
- Luogu deep foundation part 1 Introduction to language Chapter 4 loop structure programming (2022.02.14)
- The child container margin top acts on the parent container
- Get the source code in the mask with the help of shims
- IIS configure FTP website
- C # use gdi+ to add text to the picture and make the text adaptive to the rectangular area
- Mmclassification annotation file generation
- libmysqlclient.so.20: cannot open shared object file: No such file or directory
猜你喜欢

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

How can people not love the amazing design of XXL job

Hands on deep learning (III) -- Torch Operation (sorting out documents in detail)

C language pointer interview question - the second bullet

165 webmaster online toolbox website source code / hare online tool system v2.2.7 Chinese version

el-table单选并隐藏全选框

Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310

xxl-job惊艳的设计,怎能叫人不爱

Hands on deep learning (43) -- machine translation and its data construction

Svg image quoted from CodeChina
随机推荐
Go context 基本介绍
C语言指针面试题——第二弹
libmysqlclient. so. 20: cannot open shared object file: No such file or directory
The 14th five year plan and investment risk analysis report of China's hydrogen fluoride industry 2022 ~ 2028
Pueue data migration from '0.4.0' to '0.5.0' versions
Report on investment analysis and prospect trend prediction of China's MOCVD industry Ⓤ 2022 ~ 2028
Nuxt reports an error: render function or template not defined in component: anonymous
How web pages interact with applets
xxl-job惊艳的设计,怎能叫人不爱
Hands on deep learning (34) -- sequence model
PHP personal album management system source code, realizes album classification and album grouping, as well as album image management. The database adopts Mysql to realize the login and registration f
C # use smtpclient The sendasync method fails to send mail, and always returns canceled
Baidu R & D suffered Waterloo on three sides: I was stunned by the interviewer's set of combination punches on the spot
百度研发三面惨遭滑铁卢:面试官一套组合拳让我当场懵逼
Write a mobile date selector component by yourself
2022-2028 global optical transparency industry research and trend analysis report
Write a jison parser from scratch (1/10):jison, not JSON
The child container margin top acts on the parent container
Report on the development trend and prospect trend of high purity zinc antimonide market in the world and China Ⓕ 2022 ~ 2027
2022-2028 global seeder industry research and trend analysis report