Language: C++

 
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
 
 double abs(double x)
 {
   if(x<0) return -x;
   else return x;       
 }
  
 int main()
 {
   double x1,y1,x2,y2,x3,y3,x4,y4;
   int n;
   cin>>n;
   while(n--)
   {
     cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
    
       double k1=(y2-y1)/(x2-x1);
       double k2=(y4-y3)/(x4-x3);
       double judge=(x2-x1)*(y4-y3)-(y2-y1)*(x4-x3);
       if((abs(judge)<0.000000000001) cout<<"YES"<<endl;
       else cout<<"NO"<<endl;     
           
   }
   //while(1);      
   return 0;    
 }

 

Compiler output:
a.cc:18:21: error: 'double abs(double)' conflicts with a previous declaration
   18 |  double abs(double x)
      |                     ^
In file included from /usr/include/c++/14/cstdlib:81,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/std_abs.h:71:3: note: previous declaration 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
a.cc: In function 'int main()':
a.cc:36:15: error: call of overloaded 'abs(double&)' is ambiguous
   36 |        if((abs(judge)<0.000000000001) cout<<"YES"<<endl;
      |            ~~~^~~~~~~
In file included from /usr/include/c++/14/cstdlib:79:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
a.cc:18:9: note: candidate: 'double abs(double)'
   18 |  double abs(double x)
      |         ^~~
a.cc:37:8: error: expected primary-expression before 'else'
   37 |        else cout<<"NO"<<endl;
      |        ^~~~
a.cc:36:57: error: expected ')' before 'else'
   36 |        if((abs(judge)<0.000000000001) cout<<"YES"<<endl;
      |          ~                                              ^
      |                                                         )
   37 |        else cout<<"NO"<<endl;
      |        ~~~~