CGL_2_A Parallel/Orthogonal
Table of contents
# Problem
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
# Explanation
# Solution
#define MAX_N 1001
Int N;
Vector2 a, b, c, d;
void input() {
cin >> N;
loop(n,0,N) {
cin >> a >> b >> c >> d;
a = b - a;
c = d - c;
if (a.parallel(c)) cout << 2 << endl;
else if (a.orthogonal(c)) cout << 1 << endl;
else cout << 0 << endl;
}
}
int main() {
input();
}
Shun
Remote freelancer. A web and mobile application enginner.
Traveling around the world based on East Asia.
I'm looking forward to your job offers from all over the world!