3 thích 0 k thích
182 đã xem

Given are the (x, y) coordinates of the endpoints of two adjacent sides of a parallelogram. Find the (x, y) coordinates of the fourth point. 

Input:

     Each line of input contains eight floating point numbers: the (x, y) coordinates of one of the endpoints of the first side followed by the (x, y) coordinates of the other endpoint of the first side, followed by the (x, y) coordinates of one of the endpoints of the second side followed by the (x, y) coordinates of the other endpoint of the second side. All coordinates are in meters, to the nearest mm. All coordinates are between −10000 and +10000. Input is terminated by end of file.

Output:

     For each line of input, print the (x, y) coordinates of the fourth point of the parallelogram in meters, to the nearest mm, separated by a single space.

 

Sample Input 1:

0.000 0.000 0.000 1.000 0.000 1.000 1.000 1.000

Sample Output 1:

1.000 0.000

Sample Input 2:

1.000 0.000 3.500 3.500 3.500 3.500 0.000 1.000

Sample Output 2:

-2.500 -2.500

 

References: CPE Questions

[Normal] Coding (C) - đã hỏi trong Introduction to Computer Programming I (C) bởi (20.9k điểm)
ID: 21792 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn
| 182 đã xem
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.7.142
©2016-2024

Những câu hỏi liên quan

1 thích 0 k thích
0 trả lời
[Normal] Essay (Open question) - đã hỏi ngày 11 tháng 2 năm 2017 trong Introduction to Computer Programming I (C) bởi The Contributor (20.9k điểm)
ID: 21898 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn
| 146 đã xem
2 thích 0 k thích
0 trả lời
[Normal] Coding (C) - đã hỏi ngày 9 tháng 2 năm 2017 trong Introduction to Computer Programming I (C) bởi The Contributor (20.9k điểm)
ID: 21881 - Xem được từ: Không giới hạn - Hiệu lực đến: Không giới hạn
| 94 đã xem
12,783 câu hỏi
183,443 trả lời
172,219 bình luận
4,824 thành viên