Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- int main () {
- int x1, y1, x2, y2, x3, y3, s1, s2, s3;
- std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
- s1 = (x1 - x2) * (x1 - x3) + (y1 - y2) * (y1 - y3);
- s2 = (x1 - x3) * (x3 - x2) + (y1 - y3) * (y3 - y2);
- s3 = (x3 - x2) * (x1 - x2) + (y3 - y2) * (y1 - y2);
- if (s1 + s2 + s3 == 0){
- std::cout << 0;
- } else {
- if (s1 + s2 == 0||s1 + s3 == 0||s2 + s3 == 0) {
- std::cout << 1;
- } else {
- if (x3 - x1 + y2 - y1 == (y3 - y1) * (x2 - x1)) {
- std::cout << 2;
- } else {
- if (s1 * s2 * s3 == 0) {
- std::cout << 4;
- } else {
- if (s1 * s2 * s3 < 0) {
- std::cout << 5;
- } else {
- std::cout << 3;
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement