TOPIC

WA 100% - help

Augusto Zd asked 10 months ago

  #include <bits/stdc++.h>

using namespace std;
int main() {
    int x1,y1,x2,y2, m;
    int dx,dy;
    do
    {
        cin >> x1 >> y1 >> x2 >> y2;
        dx = x2-x1;
        dy = y2-y1;

        if(x1 == x2 && y1 == y2)
            m=0;
        else if(dx == dy || dx == -dy || x1 == x2 || y1 == y2)
            m=1;
        else
            m=2;
        cout << m << endl;
    }while(x1 != 0 && x2 != 0 && y1 != 0 && y2 != 0);

    return 0;
}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.