criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
using namespace std;

struct vec{double x;double y;};
double naiseki(vec a,vec b)
{
	return a.x*b.x+a.y*b.y;
}

int main()
{
	double xp1,xp2,yp1,yp2;
	cin>>xp1>>yp1>>xp2>>yp2;
	int q;cin>>q;
	vec base;
	base.x=xp2-xp1;
	base.y=yp2-yp1;
	cout<</*fixed<<*/setprecision(10);
	for(int i=0;i<q;i++)
	{
		double s,t;
		cin>>s>>t;
		vec hypo;
		hypo.x=s-xp1;
		hypo.y=t-yp1;
		cout<<xp1+base.x*naiseki(hypo,base)/naiseki(base,base)<<" ";
		cout<<(double)yp1+base.y*naiseki(hypo,base)/naiseki(base,base)<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'setprecision' was not declared in this scope
   18 |         cout<</*fixed<<*/setprecision(10);
      |                          ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

struct vec{double x;double y;};
double naiseki(vec a,vec b)
{
	return a.x*b.x+a.y*b.y;
}

int main()
{
	double xp1,xp2,yp1,yp2;
	cin>>xp1>>yp1>>xp2>>yp2;
	int q;cin>>q;
	vec base;
	base.x=xp2-xp1;
	base.y=yp2-yp1;
	
	for(int i=0;i<q;i++)
	{
		double s,t;
		cin>>s>>t;
		vec hypo;
		hypo.x=s-xp1;
		hypo.y=t-yp1;
		cout<<fixed<<setprecision(10)<<xp1+base.x*naiseki(hypo,base)/naiseki(base,base)<<" ";
		cout<<(double)yp1+base.y*naiseki(hypo,base)/naiseki(base,base)<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: 'setprecision' was not declared in this scope
   26 |                 cout<<fixed<<setprecision(10)<<xp1+base.x*naiseki(hypo,base)/naiseki(base,base)<<" ";
      |                              ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include<bits/stdc++.h>

using namespace std;

const double EPS = 1e-8, PI = acos(-1);

inline bool eq(double a, double b) { return fabs(b - a) < EPS; }

using Point = complex< double >;

istream &operator>>(istream &is, Point &p) {
  double a, b;
  is >> a >> b;
  p = Point(a, b);
  return is;
}

ostream &operator<<(ostream &os, Point &p) {
  os << fixed << setprecision(10) << p.real() << " " << p.imag();
}

Point rotate(double theta, const Point &p) {
  return Point(cos(theta) * p.real() - sin(theta) * p.imag(), sin(theta) * p.real() + cos(theta) * p.imag());
}

double radian_to_degree(double r) {
  return (r * 180.0 / PI);
}

double degree_to_radian(double d) {
  return (d * PI / 180.0);
}

double get_angle(const Point &a, const Point &b, const Point &c) {
  const Point v(b - a), w(c - b);
  double alpha = atan2(v.imag(), v.real()), beta = atan2(w.imag(), w.real());
  if(alpha > beta) swap(alpha, beta);
  double theta = (beta - alpha);
  return min(theta, 2 * acos(-1) - theta);
}

namespace std {
  bool operator<(const Point &a, const Point &b) {
    return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
  }
}


struct Line {
  Point a, b;

  Line() {}

  Line(Point a, Point b) : a(a), b(b) {}

  Line(double A, double B, double C) // Ax + By = C
  {
    if(eq(A, 0)) a = Point(0, C / B), b = Point(1, C / B);
    else if(eq(B, 0)) b = Point(C / A, 0), b = Point(C / A, 1);
    else a = Point(0, C / B), b = Point(C / A, 0);
  }

  friend ostream &operator<<(ostream &os, Line &p) {
    return os << p.a << " to " << p.b;
  }

  friend istream &operator>>(istream &is, Line &a) {
    return is >> a.a >> a.b;
  }
};

struct Segment : Line {
  Segment() {}

  Segment(Point a, Point b) : Line(a, b) {}
};

double dot(const Point &a, const Point &b) {
  return real(a) * real(b) + imag(a) * imag(b);
}

Point projection(const Line &l, const Point &p) {
  double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
  return l.a + (l.a - l.b) * t;
}


int main() {
  Line l;
  cin >> l;
  int Q;
  cin >> Q;
  while(Q--) {
    Point p;
    cin >> p;
    p = projection(l, p);
    cout << fixed << setprecision(10) << p.x << " " << p.y << endl;
  }
}



Compiler output:
a.cc: In function 'std::ostream& operator<<(std::ostream&, Point&)':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'int main()':
a.cc:97:44: error: 'using Point = class std::complex<double>' {aka 'class std::complex<double>'} has no member named 'x'
   97 |     cout << fixed << setprecision(10) << p.x << " " << p.y << endl;
      |                                            ^
a.cc:97:58: error: 'using Point = class std::complex<double>' {aka 'class std::complex<double>'} has no member named 'y'
   97 |     cout << fixed << setprecision(10) << p.x << " " << p.y << endl;
      |                                                          ^
Language: C++

type Vector a = (a, a)
add :: (Floating a) => Vector a -> Vector a -> Vector a
add (vx,vy) (wx,wy) = (vx+wx,vy+wy)

neg :: (Floating a) => Vector a -> Vector a
neg (x,y) = (-x,-y)

dotprod :: (Floating a) => Vector a -> Vector a -> a
dotprod (vx,vy) (wx,wy) = vx*wx + vy*wy

sprod :: (Floating a) => a -> Vector a -> Vector a
sprod c (x,y) = (c*x, c*y)

norm :: (Floating a) => Vector a -> a
norm (x,y) = x**2 + y**2

pshow :: (Show a) => Vector a -> String
pshow (x,y) = show x ++ ' ':show y

v = (1,2) :: Vector Float
w = (3,0) :: Vector Float

main = do
    [ax,ay,bx,by] <- map read . words `fmap` getLine :: IO [Float]
    let (a,b) = ((ax,ay),(bx,by)) :: (Vector Float, Vector Float)
    q <- read `fmap` getLine :: IO Int
    points <- sequence (take q (repeat ((\[x,y] -> (x,y)) . map read . words `fmap` getLine))) :: IO [Vector Float]
    mapM (putStrLn . pshow) $ solve a b points

solve :: (Floating a) => Vector a -> Vector a -> [Vector a] -> [Vector a]
solve va vb = map (intersection va vb)

intersection :: (Floating a) => Vector a -> Vector a -> Vector a -> Vector a
intersection a b p = a `add` (sprod coeff b_a)
    where b_a = add b (neg a)
          p_a = add p (neg a)
          coeff = dotprod b_a p_a / norm b_a



Compiler output:
a.cc:24:39: error: stray '`' in program
   24 |     [ax,ay,bx,by] <- map read . words `fmap` getLine :: IO [Float]
      |                                       ^
a.cc:24:44: error: stray '`' in program
   24 |     [ax,ay,bx,by] <- map read . words `fmap` getLine :: IO [Float]
      |                                            ^
a.cc:26:15: error: stray '`' in program
   26 |     q <- read `fmap` getLine :: IO Int
      |               ^
a.cc:26:20: error: stray '`' in program
   26 |     q <- read `fmap` getLine :: IO Int
      |                    ^
a.cc:27:42: error: stray '\' in program
   27 |     points <- sequence (take q (repeat ((\[x,y] -> (x,y)) . map read . words `fmap` getLine))) :: IO [Vector Float]
      |                                          ^
a.cc:27:78: error: stray '`' in program
   27 |     points <- sequence (take q (repeat ((\[x,y] -> (x,y)) . map read . words `fmap` getLine))) :: IO [Vector Float]
      |                                                                              ^
a.cc:27:83: error: stray '`' in program
   27 |     points <- sequence (take q (repeat ((\[x,y] -> (x,y)) . map read . words `fmap` getLine))) :: IO [Vector Float]
      |                                                                                   ^
a.cc:34:24: error: stray '`' in program
   34 | intersection a b p = a `add` (sprod coeff b_a)
      |                        ^
a.cc:34:28: error: stray '`' in program
   34 | intersection a b p = a `add` (sprod coeff b_a)
      |                            ^
a.cc:1:1: error: 'type' does not name a type; did you mean 'typeof'?
    1 | type Vector a = (a, a)
      | ^~~~
      | typeof
Language: C++

#include <cstdio>
#include<complex>

using namespace std;
typedef complex<double> P;
 
P project(P a, P b, P c){
  b -= a, c -= a;
  return a + b * real(c / b);
}

int main(){
  int n;
  double ax, ay, bx, by, cx, cy;
  cin >> ax >> ay >> bx >> by >> n;
  while(n--) {
    cin >> cx >> cy;
    P p = project(P(ax, ay), P(bx, by), P(cx, cy));
    printf("%.8f %.8f\n",p.real(),p.imag());
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope
   15 |   cin >> ax >> ay >> bx >> by >> n;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<complex>
  +++ |+#include <iostream>
    3 |
Language: C

#include <stdio.h>
#include <math.h>
#define EPS 0.0000000002
#define MAX 1010001000

typedef struct point{
    double x, y;
}point;

typedef struct line{
    point st, en;
}line;

double norm(point a);
double norm2(point a);
double distans(point a, point b);
point sum_vector(point a, point b);
point diff_vector(point a, point b);
point minus_vector(point a);
double dot(point a, point b);
double prod(point a, point b);

point reflection(line a, point p);
point pv(line a, point p);

point reflection(line a, point p)
{
    //直線aについて点pと線対称な点を返す
    return sum_vector(pv(ab, p), diff_vector(pv(ab, p), p));
}

point pv(line a, point p)
{
    //直線ab上に点pから垂線を下ろしたときの点h//
    point h;
    double k = dot(diff_vector(a.st, p), diff_vector(a.st, a.en))
                / dot(diff_vector(a.en, a.st), diff_vector(a.en, a.st));
    h.x = k * (a.en.x - a.st.x) + a.st.x;
    h.y = k * (a.en.y - a.st.y) + a.st.y;
    return h;
}

double norm(point a)
{
    //原点からの距離
    return sqrt((a.x * a.x) + (a.y * a.y));
}

double norm2(point a)
{
    //原点からの距離の二乗
    return (a.x * a.x) + (a.y * a.y);
}

double distans(point a, point b)
{
    //二点間の距離
    point tmp = sum_vector(b, minus_vector(a));
    return norm(tmp);
}

point sum_vector(point a, point b)
{
    //ベクトルの和
    a.x += b.x;
    a.y += b.y;
    return a;
}

point diff_vector(point a, point b)
{
    //ベクトルの差
    a.x -= b.x;
    a.y -= b.y;
    return a;
}

point minus_vector(point a)
{
    //逆ベクトル
    a.x *= -1;
    a.y *= -1;
    return a;
}

double dot(point a, point b)
{
    //内積
    return (a.x * b.x) + (a.y * b.y);
}

double prod(point a, point b)
{
    //外積
    return (a.x * b.y) - (b.x * a.y);
}

///////////////////////////////////////

int main(void)
{
    point p;
    line ab;
    int n, i;

    scanf("%lf%lf%lf%lf%d", &ab.st.x, &ab.st.y, &ab.en.x, &ab.en.y, &n);
    for (i = 0; i < n; i++) {
        scanf("%lf%lf", &p.x, &p.y);
        p = reflection(ab, p);
        printf("%.10lf %.10lf\n", p.x, p.y);
    }

    return 0;

}

Compiler output:
main.c: In function 'reflection':
main.c:29:26: error: 'ab' undeclared (first use in this function); did you mean 'a'?
   29 |     return sum_vector(pv(ab, p), diff_vector(pv(ab, p), p));
      |                          ^~
      |                          a
main.c:29:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
#include<cstdio>
#include<complex>

typedef double type_n;
typedef complex<type_n> point;

int main()
{
    point a, b, c, z, h, w;
    int i, q;
    type_n a1, a2, b1, b2, z1, z2;
    scanf("%lf %lf %lf %lf", &a1, &a2, &b1, &b2);
    a.real(a1), a.imag(a2), b.real(b1), b.imag(b2);
    c = b - a;

    scanf("%d", &q);
    for(i = 0; i < q; i++){
        scanf("%lf %lf", &z1, &z2);
        z.real(z1), z.imag(z2);
        h = a + c * (((z - a) / c).real());
        w = 2 * h - z;
        printf("%.12f %.12f\n", w.real(), w.imag());
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: no match for 'operator*' (operand types are 'int' and 'point' {aka 'std::complex<double>'})
   23 |         w = 2 * h - z;
      |             ~ ^ ~
      |             |   |
      |             int point {aka std::complex<double>}
In file included from a.cc:4:
/usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
  400 |     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:400:5: note:   template argument deduction/substitution failed:
a.cc:23:17: note:   mismatched types 'const std::complex<_Tp>' and 'int'
   23 |         w = 2 * h - z;
      |                 ^
/usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
  409 |     operator*(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:409:5: note:   template argument deduction/substitution failed:
a.cc:23:17: note:   mismatched types 'const std::complex<_Tp>' and 'int'
   23 |         w = 2 * h - z;
      |                 ^
/usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
  418 |     operator*(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:418:5: note:   template argument deduction/substitution failed:
a.cc:23:17: note:   deduced conflicting types for parameter '_Tp' ('int' and 'double')
   23 |         w = 2 * h - z;
      |                 ^
Language: C++

#include <iostream>
#include <complex>
#include <cstdio>
using namespace std;
typedef complex<double> P;
#define X real()
#define Y imag()

double dot(P a, P b){
  return (a.X * b.X + a.Y * b.Y);
}

P projection(P a, P b){
  //a???????????????b??????????????????????????£?°???±?????????????????????
  return dot(a,b)/abs(b)/abs(b)*b;
}

P line_symmetry(L l, P p){
  return (l.first - p + projection(p,P(l.second-l.first)))*2.0;
}

int main(){
  P p1, p2;
  double x1, x2, y1, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  p1 = P(x1,y1);
  p2 = P(x2,y2);
  p2 -= p1;
  int q;
  cin >> q;
  for(int i = 0; i < q; ++i){
    P p;
    cin >> x1 >> y1;
    p = line_symmetory(L(p1,p2),P(x1,y1));
    printf("%.9lf %.8lf\n",p.X,p.Y);
  }
  return 0;
}

Compiler output:
a.cc:18:17: error: 'L' was not declared in this scope
   18 | P line_symmetry(L l, P p){
      |                 ^
a.cc:18:24: error: expected primary-expression before 'p'
   18 | P line_symmetry(L l, P p){
      |                        ^
a.cc:18:26: error: expected ',' or ';' before '{' token
   18 | P line_symmetry(L l, P p){
      |                          ^
a.cc: In function 'int main()':
a.cc:34:24: error: 'L' was not declared in this scope
   34 |     p = line_symmetory(L(p1,p2),P(x1,y1));
      |                        ^
a.cc:34:9: error: 'line_symmetory' was not declared in this scope; did you mean 'line_symmetry'?
   34 |     p = line_symmetory(L(p1,p2),P(x1,y1));
      |         ^~~~~~~~~~~~~~
      |         line_symmetry
Language: C++

#include <iostream>
#include <complex>
#include <cstdio>
#include <utility>
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
#define X real()
#define Y imag()

double dot(P a, P b){
  return (a.X * b.X + a.Y * b.Y);
}

P projection(P a, P b){
  //a???????????????b??????????????????????????£?°???±?????????????????????
  return dot(a,b)/abs(b)/abs(b)*b;
}

P line_symmetry(L l, P p){
  return (l.first - p + projection(p,P(l.second-l.first)))*2.0;
}

int main(){
  P p1, p2;
  double x1, x2, y1, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  p1 = P(x1,y1);
  p2 = P(x2,y2);
  p2 -= p1;
  int q;
  cin >> q;
  for(int i = 0; i < q; ++i){
    P p;
    cin >> x1 >> y1;
    p = line_symmetory(L(p1,p2),P(x1,y1));
    printf("%.9lf %.8lf\n",p.X,p.Y);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'line_symmetory' was not declared in this scope; did you mean 'line_symmetry'?
   36 |     p = line_symmetory(L(p1,p2),P(x1,y1));
      |         ^~~~~~~~~~~~~~
      |         line_symmetry
Language: C++

 import Control.Applicative
import Control.Monad
import Debug.Trace

data Vector2 = V Double Double deriving Show

main = do
  [x1,y1,x2,y2] <- map read.words<$>getLine
  q <- readLn
  replicateM_ q (solve (V x1 y1) (V x2 y2))

solve :: Vector2 -> Vector2 -> IO ()
solve p1 p2 = do
  [x,y] <- map read.words<$>getLine
  let vecp = add (V x y) (negV p1)
      vecb = add p2 (negV p1)
      inner = dot vecp vecb :: Double
      size  = norm vecb :: Double
  traceShow (x,vecp,size) $ showPoint $ add p1 $ scalar (inner/size) $ scalar (1/size) vecb

showPoint :: Vector2 -> IO ()
showPoint (V x y) = putStrLn $ show x ++ " " ++ show y

add :: Vector2 -> Vector2 -> Vector2
add (V x1 y1) (V x2 y2) = V (x1+x2) (y1+y2)

negV :: Vector2 -> Vector2
negV (V x y) = V (negate x) (negate y)

dot :: Vector2 -> Vector2 -> Double
dot (V x1 y1) (V x2 y2) = x1*x2 + y1*y2

scalar :: Double -> Vector2 -> Vector2
scalar a (V x y) = V (a*x) (a*y)

norm :: Vector2 -> Double
norm (V x y) = sqrt $ x^2 + y^2

Compiler output:
a.cc:1:2: error: 'import' does not name a type
    1 |  import Control.Applicative
      |  ^~~~~~
a.cc:1:2: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

import Control.Applicative
import Control.Monad
import Debug.Trace

data Vector2 = V Double Double deriving Show

main = do
  [x1,y1,x2,y2] <- map read.words<$>getLine
  q <- readLn
  replicateM_ q (solve (V x1 y1) (V x2 y2))

solve :: Vector2 -> Vector2 -> IO ()
solve p1 p2 = do
  [x,y] <- map read.words<$>getLine
  let vecp = add (V x y) (negV p1)
      vecb = add p2 (negV p1)
      inner = dot vecp vecb :: Double
      size  = norm vecb :: Double
  traceShow (x,vecp,size) $ showPoint $ add p1 $ scalar (inner/size) $ scalar (1/size) vecb

showPoint :: Vector2 -> IO ()
showPoint (V x y) = putStrLn $ show x ++ " " ++ show y

add :: Vector2 -> Vector2 -> Vector2
add (V x1 y1) (V x2 y2) = V (x1+x2) (y1+y2)

negV :: Vector2 -> Vector2
negV (V x y) = V (negate x) (negate y)

dot :: Vector2 -> Vector2 -> Double
dot (V x1 y1) (V x2 y2) = x1*x2 + y1*y2

scalar :: Double -> Vector2 -> Vector2
scalar a (V x y) = V (a*x) (a*y)

norm :: Vector2 -> Double
norm (V x y) = sqrt $ x^2 + y^2

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Applicative
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<iomanip>
#include<cstdio>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef stack<int> SI;
typedef queue<int> QI;
typedef list<int> LI;
typedef pair<int,int> PII;
typedef long long LL;

#define d(x)  cout<<#x<<" = "<<(x)<<endl;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define EMP empty()
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define REACH(i,c) for(typeof((c).rbegin()) i=(c).rbegin(); i!=(c).rend(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c,n) sort(c,c+n)
#define VSORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define DFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define DREP(i,n) DFOR(i,n,0)
#define INF 1000000000

const double EPS = 1e-10;
const double PI  = acos(-1.0);
////////////////////////////////////////////////
struct vec{double x;double y;};
double naiseki(vec a,vec b)
{
    return a.x*b.x+a.y*b.y;
}
 
int main()
{
    double xp1,xp2,yp1,yp2;
    cin>>xp1>>yp1>>xp2>>yp2;
    int q;cin>>q;
    vec base;
    base.x=xp2-xp1;
    base.y=yp2-yp1;
    cout<<fixed<<setprecision(10);
     
    for(int i=0;i<q;i++)
    {
        double s,t;
        cin>>s>>t;
        vec hypo;
        hypo.x=s-xp1;
        hypo.y=t-yp1;
        double x,y;
        x=cout<<xp1+base.x*naiseki(hypo,base)/naiseki(base,base);
        y=yp1+base.y*naiseki(hypo,base)/naiseki(base,base);
        cout<<x+x-s<<" ";
        cout<<y+y-t<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:15: error: cannot convert 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'double' in assignment
   71 |         x=cout<<xp1+base.x*naiseki(hypo,base)/naiseki(base,base);
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |               |
      |               std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}
Language: C++

#include<iostream>

#include<cstdio>
#include<math.h>
#include<float.h>
using namespace std;
#define equals(a,b) fabs((a)-(b))<DBL_EPSILON*fmax(1,fmax(fabs(a),fabs(b)))
class Point{
    public:
        double x,y;
        Point(double x=0,double y=0):x(x),y(y){}

        Point operator + (Point p){return Point(x+p.x,y+p.y);}
        Point operator - (Point p){return Point(x-p.x,y-p.y);}
        Point operator * (double a){return Point(a*x,a*y);}
        Point operator / (double a){return Point(x/a,y/a);}
            
        double norm(){return x*x+y*y;}
        double abs(){return sqrt(norm());}    
        
        bool operator < (const Point &p)const{
            return x!=p.x?x<p.x:y<p.y;
        }
        bool operator == (const Point &p)const{
            return equals(x,p.x)&&equals(y,p.y);
        }
};
typedef Point Vector;
struct Segment{
    Point p1,p2;
};
typedef Segment Line;
double dot(Vector a,Vector b){//内積
    return a.x*b.x+a.y*b.y;
}
Point project(Segment s,Point p){ //射影　p377
    Vector base=s.p2-s.p1;
    double r=dot(p-s.p1,base)/base.norm();
    return s.p1+base*r;
}
Point reflect(Segment s,Point p){
    return p+(project(s,p)-p)*2.0;
}
int main(){
    int q;
    Point p1,p2;
    scanf("%lf %lf %lf %lf",&p1.x,&p1.y,&p2.x,&p2.y);
    Segment s;
    s.p1=p1;  s.p2=p2;
    cin>>q;
    Point p,pp;
    for(int i=0;i<q;i++){
        cin>>p.x>>p.y;
        pp=reflect(s,p);
        printf("%.10f %.10f\n",pp.x,pp.y);
    }



Compiler output:
a.cc: In function 'int main()':
a.cc:56:6: error: expected '}' at end of input
   56 |     }
      |      ^
a.cc:44:11: note: to match this '{'
   44 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

struct Point{
  double x,y;

  Point(double x = 0,double y = 0) : x(x), y(y) {}

  Point operator + (const Point &p)const{
    return Point(x + p.x , y + p.y);
  }

  Point operator - (const Point &p)const{
    return Point(x - p.x , y - p.y);
  }

  Point operator * (const double &k)const{
    return Point(x * k , y * k);
  }

  Point operator / (const double &k)const{
    return Point(x / k , y / k);
  }
  double norm(){
    return x*x + y*y;
  }
  double dot(const Point &p)const{
    return x*p.x + y*p.y;
  }
};
typedef Point Vector;

struct Segment{
  Vector s, t;

  Segment(){}
  Segment(Vector s, Vector t) : s(s), t(t) {}

  Point Projection(Point p){
    Vector base = t - s;
    double t = (p-s).dot(base) / base.norm();
    return s + base*t;
  }
  Point Reflection(const Point &p)const{
    return p + (Projection(p) - p) * 2.0;
  }
};

int main(){
  Point p1, p2, p3;
  int q;

  std::cin >> p1.x >> p1.y >> p2.x >> p2.y >> q;
  Segment s = Segment(p1, p2);
  for(int i = 0 ; i < q ; i++){
    std::cin >> p3.x >> p3.y;
    Point p = s.Reflection(p3);
    printf("%.10f %.10f\n",p.x ,p.y);
  }

  return 0;
}

Compiler output:
a.cc: In member function 'Point Segment::Reflection(const Point&) const':
a.cc:44:27: error: passing 'const Segment' as 'this' argument discards qualifiers [-fpermissive]
   44 |     return p + (Projection(p) - p) * 2.0;
      |                 ~~~~~~~~~~^~~
a.cc:38:9: note:   in call to 'Point Segment::Projection(Point)'
   38 |   Point Projection(Point p){
      |         ^~~~~~~~~~
Language: C++

66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666











Compiler output:
a.cc:1:1: warning: integer constant is too large for its type
    1 | 66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before numeric constant
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
	double p1x, p1y, p2x, p2y, p0x, p0y;
	int q;

	scanf_s("%lf %lf %lf %lf", &p0x, &p0y, &p1x, &p1y);

	pair<double, double> v01 = { p1x - p0x, p1y - p0y };


	scanf_s("%d", &q);

	for (int i = 0; i < q; i++)
	{
		scanf_s("%lf %lf", &p2x, &p2y);

		if ((p2x == p0x && p2y == p0y) || (p2x == p1x && p2y == p0y)){
			printf("ONLINE_SEGMENT\n");

			continue;
		}

		pair<double, double> v02 = { p2x - p0x, p2y - p0x };

		if (v01.first*v02.second == v01.second*v02.first)
		{
			if (v01.first*v02.first < 0)
			{
				printf("ONLINE_BACK\n");
				continue;
			}
			else
			{
				abs(v01.first) < abs(v02.first) ? printf("ONLINE_FRONT\n") : printf("ONLINE_SEGMENT\n");
				continue;
			}
		}

		double y01 = (v01.second / v01.first)*(p2x - p0x) + p0y;
		y01 < p2y ? printf("COUNTER_CLOCKWISE\n") : printf("CLOCKWISE\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   15 |         scanf_s("%lf %lf %lf %lf", &p0x, &p0y, &p1x, &p1y);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<stdio.h>
#include<iostream>
#include<fstream>
#include<iomanip>
#include<math.h>
using namespace std;

template <class T>
class _Point{
public:
	T x;
	T y;
	_Point(){}
	_Point(T _x, T _y) :x(_x), y(_y){}
	_Point(const _Point & v) :x(v.x), y(v.y){}

	const _Point operator + (const _Point & v)
	{
		return _Point(x+v.x,y+v.y);
	}
	const _Point operator - (const _Point & v)
	{
		return _Point(x - v.x, y - v.y);
	}
	T abs() const {
		return sqrt(x*x + y*y);
	}
	_Point unit() const{
		T len = abs();
		return _Point(x / len, y / len);
	}
	T operator*(const _Point &v) const
	{
		return x * v.x + y * v.y;
	}
	const _Point operator*(const T &len) const
	{
		return _Point(len * x, len * y);
	}
};
typedef double R;
typedef _Point<R> Point;
typedef Point Vector;

int main(){
	std::istream & c_in = cin;

	Point p0, p1;
	c_in >> p0.x >> p0.y >> p1.x >> p1.y;
	Vector P10(p1 - p0);
	Vector e10(P10.unit());

	int q;
	c_in >> q;
	for (int i = 0; i < q; ++i)
	{
		Point p2;
		c_in >> p2.x >> p2.y;

		Vector P20 = p2 - p0;
		Vector e20(P20.unit());
		bool zero = P20.abs() < DBL_EPSILON*16;
		R projection = e10*e20;
		if (zero)
		{
			//(5)
			cout << "ON_SEGMENT";
		}
		else if (fabs(projection) > 1 - DBL_EPSILON * 16)
		{
			//??´???
			if (projection > 0)
			{
				if (P20.abs() <= P10.abs())
				{
					//(5)
					cout << "ON_SEGMENT";
				}
				else {
					//(4)
					cout << "ONLINE_FRONT";
				}
			}
			else
			{
				//(3)
				cout << "ONLINE_BACK";

			}
		}
		else
		{
			Vector ey(-e10.y, e10.x);
			R projection2 = ey*P20;
			if (projection2 > 0)
			{
				//???????¨??????????????????´??? (1) 
				cout << "COUNTER_CLOCKWISE";
			}
			else
			{
				//????¨??????????????????´???(2) 
				cout << "CLOCKWISE";
			}
		}
		cout << endl;

	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:41: error: 'DBL_EPSILON' was not declared in this scope
   62 |                 bool zero = P20.abs() < DBL_EPSILON*16;
      |                                         ^~~~~~~~~~~
Language: C++

#ifndef ___Geometry_Library
#define ___Geometry_Library

// ------ Includes ------ //
#include <cmath>
#include <complex>
#include <utility>
#include <algorithm>

// ------ Defines ------ //
typedef long double GType;
typedef std::complex<GType> Point;
typedef std::pair<Point, Point> Segment;

// ------ Constants ------ //
const GType EPS = 1.0e-10L;

// ------ Functions Level 1 ------ //
GType dot(const Point& p1, const Point& p2) {
	return (std::conj(p1) * p2).real();
}
GType cross(const Point& p1, const Point& p2) {
	return (std::conj(p1) * p2).imag();
}
int ccw(const Point& p1, const Point& p2, const Point& p3) {
	Point v1 = p2 - p1, v2 = p3 - p1;
	if (cross(v1, v2) > EPS) return +1;
	if (cross(v1, v2) < -EPS) return -1;
	if (dot(v1, v2) < -EPS) return +2;
	if (std::norm(v1) < std::norm(v2)) return -2;
	return 0;
}

#endif

#include <iomanip>
#include <iostream>
using namespace std;
int q, xa, ya, xb, yb; Point p1, p2, p3;
int main() {
	cin >> xa >> ya >> xb >> yb;
	p1 = Point(xa, ya);
	p2 = Point(xb. yb);
	cin >> q;
	while (q--) {
		cin >> xa >> ya; p3 = Point(xa, ya);
		int res = ccw(p1, p2, p3);
		if(res == +1) cout << "COUNTER_CLOCKWISE" << endl;
		if(res == -1) cout << "CLOCKWISE" << endl;
		if(res == +2) cout << "ONLINE_BACK" << endl;
		if(res == -2) cout << "ONLINE_FRONT" << endl;
		if(res == +0) cout << "ON_SEGMENT" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:24: error: request for member 'yb' in 'xb', which is of non-class type 'int'
   43 |         p2 = Point(xb. yb);
      |                        ^~
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]
#define prev(P, i) P[(i+P.size()-1) % P.size()]

using namespace std;

double EPS = 1e-10;
const double PI = acos(-1);

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }

  point operator / (double d){
    return point(x/d,y/d);
  }
};

typedef point Vector;

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

double norm(point a){
  return sqrt(a.x*a.x+a.y*a.y);
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw( point p0, point p1, point p2 ){
  Vector a=p1-p0;
  Vector b=p2-p0;
  if (cross(a,b)>EPS) return COUNTER_CLOCKWISE;
  if (cross(a,b)<-EPS) return CLOCKWISE;
  if (dot(a, b)<-EPS) return ONLINE_BACK;
  if (norm(a)<norm(b)) return ONLINE_FRONT;
  return ON_SEGMENT;
}
int main(void){
  point a,b,c;
  int q;
  cin >> a.x >> a.y >> b.x >> b.y;
  cin >> q;
  while(q--){
    cin >> c.x >> c.y;
    int res=ccw(a,b,c);
    if(res==COUNTER_CLOCKWISE)cout << "COUNTER_CLOCKWISE" << endl;
    else if(res==CLOCKWISE)cout << "CLOCKWISE" << endl;
    else if(res==ONLINE_BACK)cout << "ONLINE_BACK" << endl;
    else if(res==ONLINE_FRONT)cout << "ONLINE_FRONT" << endl;
    else if(res==ON_SEGMENT)cout << "ON_SEGMENT" << endl;
  }

  return 0;
}

Compiler output:
a.cc:13:19: error: 'acos' was not declared in this scope
   13 | const double PI = acos(-1);
      |                   ^~~~
a.cc: In function 'double norm(point)':
a.cc:53:10: error: 'sqrt' was not declared in this scope
   53 |   return sqrt(a.x*a.x+a.y*a.y);
      |          ^~~~
Language: C

#include <stdio.h>
#include <math.h>

#define PREC 1e-12

int main() {
    int x, y, x0, y0, x1, y1, x2, y2, x3, y3;
    int q;
    double v1x, v1y, v2x, v2y, cosa;
    int judge;

    scanf("%d", &q);
    
    while (q--) {
        scanf("%d %d %d %d %d %d %d %d",
              &x0, &y0, &x1, &y1, &x2, &y2, &x3, &y3);
        v1x = x1 - x0;
        v1y = y1 - y0;
        v2x = x3 - x2;
        v2y = y3 - y2;
        cosa = (v1x*v2x + v1y*v2y) /
            (sqrt(v1x*v1x+v1y*v1y) * sqrt(v2x*v2x+v2y*v2y));

        if (fabs(cosa) < PREC) {
            judge = 1;
        }
        else if (fabs(fabs(cosa) - 1.0) < PREC) {
            judge = 2;
        }
        else {
            judge = 0;
        }
        printf("%d\n",　judge);
    }
}

Compiler output:
main.c: In function 'main':
main.c:33:23: error: stray '\343' in program
   33 |         printf("%d\n",<U+3000>judge);
      |                       ^~~~~~~~
Language: C++

# coding: utf-8
# Here your code !

q = int(raw_input())
for i in range(q):
    xp0, yp0, xp1, yp1, xp2, yp2, xp3, yp3 = map(float,raw_input().split())
    if xp1 - xp0 == 0:
        if xp3 - xp2 == 0:
            print 2
        elif yp3 - yp2 == 0:
            print 1
        else:
            print 0
    elif xp3 - xp2 == 0:
        if xp1 - xp0 == 0:
            print 2
        elif yp1 - yp0 == 0:
            print 1
        else:
            print 0
    
    else:
        s1 = (yp1 - yp0, xp1 - xp0)
        s2 = (yp3 - yp2, xp3 - xp2)
        if s1[0]/s1[1] == s2[0]/s2[1]:
            print 2
        elif s1[0]*s2[0] + s1[1]*s2[1] == 0:
            print 1
        else:
            print 0

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Here
    2 | # Here your code !
      |   ^~~~
a.cc:4:1: error: 'q' does not name a type
    4 | q = int(raw_input())
      | ^
Language: C++

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C
#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

class Point{
private:
    double x_;
    double y_;
public:
    Point();
	Point(double x, double y);
	Point(const Point& P);

    ~Point();
    Point& operator=(const Point &P);
	Point& operator+(const Point &P);
    Point& operator+(double k);
	Point& operator-(const Point &P);
    Point& operator-(double k);

	//?????????
	Point& operator*(double k);

    void disp(){
        //printf("%3f %3f\n", x_, y_);
        cout << x_ << " " << y_ << endl;}
    double length(){return x_*x_ + y_*y_;};
    double cross(Point Q){return x_*Q.y() - Q.x()*y_;};
    double dot(Point Q){return x_*Q.x() + y_*Q.y();};

    inline double x() const {return x_;}
    inline double y() const {return y_;}
};


Point::Point():
	x_(0.0),
	y_(0.0)
{

}

Point::Point(double x, double y):
	x_(x),
	y_(y)
{

}

Point::Point(const Point& P):
    x_(0.0),
    y_(0.0)
{
	this->operator=(P);
}

Point::~Point(){

}

Point& Point::operator=(const Point &P){
	this->x_ = P.x_;
	this->y_ = P.y_;
	return *this;
}

Point& Point::operator+(const Point &P){
	x_ += P.x_;
	y_ += P.y_;
	return *this;
}

Point& Point::operator+(double k){
	x_ += k;
	y_ += k;
	return *this;
}

Point& Point::operator-(const Point &P){
	x_ -= P.x_;
	y_ -= P.y_;
	return *this;
}

Point& Point::operator-(double k){
	x_ -= k;
	y_ -= k;
	return *this;
}


Point& Point::operator*(double k){
	x_ *= k;
	y_ *= k;
	return *this;
}





int main(){
    int n;
    double a,b,c,d,e,f,g,h;
    cin >> n;
    cout << endl;
    for(int i=0; i<n; i++){
        cin >> a >> b >> c >> d >> e >> f >> g >> h;
        Point P(c-a, d-b);
        Point Q(g-e, h-f);
        if(cross(P,Q)==0) cout << 2 << endl;
        else{
            if(dot(P,Q)==0) cout << 1 << endl;
            else cout << 0 << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:114:12: error: 'cross' was not declared in this scope
  114 |         if(cross(P,Q)==0) cout << 2 << endl;
      |            ^~~~~
a.cc:116:16: error: 'dot' was not declared in this scope
  116 |             if(dot(P,Q)==0) cout << 1 << endl;
      |                ^~~
Language: C++

#include <cmath>
#include <cstdio>

#define EPS 0.00000000001L

#define PI 3.141592653589793238462643383279L

int main()
{
    int q, x1, y1, x2, y2, x3, y3, x4, y4;
    
    scanf("%d", &q);
    
    for(int i = 0; i < q; i++)
    {
        scanf("%d", &x1);
        scanf("%d", &y1);
        scanf("%d", &x2);
        scanf("%d", &y2);
        scanf("%d", &x3);
        scanf("%d", &y3);
        scanf("%d", &x4);
        scanf("%d", &x4);
        
        long double angle1 = atan2l(y2 - y1, x2 - x1);
        long double angle2 = atan2l(y4 - y3, x4 - x3);
        
        long double sa = labs(angle2 - angle1);
        
        if(sa < -EPS) { sa += PI * 2.0; }
        
        if(sa == PI * 0.5 || sa == PI * 1.5)
        {
            cout << 1 << endl;
        }
        else if(sa == PI || sa == 0)
        {
            cout << 2 << endl;
        }
        else
        {
            cout << 0 << endl;
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'cout' was not declared in this scope
   34 |             cout << 1 << endl;
      |             ^~~~
a.cc:34:26: error: 'endl' was not declared in this scope
   34 |             cout << 1 << endl;
      |                          ^~~~
a.cc:38:13: error: 'cout' was not declared in this scope
   38 |             cout << 2 << endl;
      |             ^~~~
a.cc:38:26: error: 'endl' was not declared in this scope
   38 |             cout << 2 << endl;
      |                          ^~~~
a.cc:42:13: error: 'cout' was not declared in this scope
   42 |             cout << 0 << endl;
      |             ^~~~
a.cc:42:26: error: 'endl' was not declared in this scope
   42 |             cout << 0 << endl;
      |                          ^~~~
Language: C++

#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;

class Point{
public:
  double x,y;
  Point(double x=0,double y=0):x(x),y(y){}

  Point operator+(Point p){return Point(x+p.x,y+p.y);}
  Point operator-(Point p){return Point(x-p.x,y-p.y);}
  Point operator*(double k){return Point(x*k,y*k);}
  Point operator/(double k){return Point(x/k,y/k);}

  double abs(){return sqrt(norm());}

  double norm(){return (x*x+y*y);}
};
typedef Point Vector;

class Segment{
public:
  Point p1,p2;
  Segment(Point p1,Point p2):p1(p1),p2(p2){}
};
typedef Segment Line;

double dot(Vector a,Vector b){return (a.x*b.x+a.y*b.y);}
double cross(Vector a,Vector b){return (a.x*b.y-a.y*b.x);}

Point project(Segment s,Point p){
  Vector base=(s.p2-s.p1);
  double r=(dot(p-s.p1,base)/base.norm());
  return (s.p1+base*r);
}

Point reflect(Segment s,Point p){
  return p+(project(s,p)-p)*2;
}

bool isOrthogonal(Vector a,Vector b){
  return equals(dot(a,b),0.0);
}

bool isParallel(Vector a,Vector b){
  return equals(cross(a,b),0.0);
}

int main()
{
  Point A,B,C,D;
  int n;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>A.x>>A.y>>B.x>>B.y>>C.x>>C.y>>D.x>>D.y;
    Vector a=A-B,b=C-D;
    if(isOrthogonal(a,b))cout<<1<<endl;
    else if(Parallel(a,b))cout<<2<<endl;
    else cout<<0<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool isOrthogonal(Vector, Vector)':
a.cc:43:10: error: 'equals' was not declared in this scope
   43 |   return equals(dot(a,b),0.0);
      |          ^~~~~~
a.cc: In function 'bool isParallel(Vector, Vector)':
a.cc:47:10: error: 'equals' was not declared in this scope
   47 |   return equals(cross(a,b),0.0);
      |          ^~~~~~
a.cc: In function 'int main()':
a.cc:60:13: error: 'Parallel' was not declared in this scope; did you mean 'isParallel'?
   60 |     else if(Parallel(a,b))cout<<2<<endl;
      |             ^~~~~~~~
      |             isParallel
Language: C++

using System;

class Program
{
  struct Vector
  {
    public int x, y;
  }

  private static bool isOrthogonal(Vector v1, Vector v2)
  {
    return v1.x*v2.x + v1.y*v2.y == 0;
  }

  private static bool isParallel(Vector v1, Vector v2)
  {
    return v2.x*v1.y - v2.y*v1.x == 0;
  }
  public static void Main()
  {
    int n = int.Parse(Console.ReadLine());

    for(int i=0; i<n; i++)
    {
      string[] s = Console.ReadLine().Split(' ');
      Vector v1, v2;
      v1.x = int.Parse(s[2]) - int.Parse(s[0]);
      v1.y = int.Parse(s[3]) - int.Parse(s[1]);
      v2.x = int.Parse(s[6]) - int.Parse(s[4]);
      v2.y = int.Parse(s[7]) - int.Parse(s[5]);

      if(isOrthogonal(v1, v2)) {
        Console.WriteLine("1");
      } else if(isParallel(v1, v2)) {
        Console.WriteLine("2");
      } else {
        Console.WriteLine("0");
      }
    }
  }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:11: error: expected ':' before 'int'
    7 |     public int x, y;
      |           ^~~~
      |           :
a.cc:8:4: error: expected ';' after struct definition
    8 |   }
      |    ^
      |    ;
a.cc:10:10: error: expected ':' before 'static'
   10 |   private static bool isOrthogonal(Vector v1, Vector v2)
      |          ^~~~~~~
      |          :
a.cc:15:10: error: expected ':' before 'static'
   15 |   private static bool isParallel(Vector v1, Vector v2)
      |          ^~~~~~~
      |          :
a.cc:19:9: error: expected ':' before 'static'
   19 |   public static void Main()
      |         ^~~~~~~
      |         :
a.cc:41:2: error: expected ';' after class definition
   41 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:21:13: error: expected primary-expression before 'int'
   21 |     int n = int.Parse(Console.ReadLine());
      |             ^~~
a.cc:25:7: error: 'string' was not declared in this scope
   25 |       string[] s = Console.ReadLine().Split(' ');
      |       ^~~~~~
a.cc:25:14: error: expected primary-expression before ']' token
   25 |       string[] s = Console.ReadLine().Split(' ');
      |              ^
a.cc:27:14: error: expected primary-expression before 'int'
   27 |       v1.x = int.Parse(s[2]) - int.Parse(s[0]);
      |              ^~~
a.cc:28:14: error: expected primary-expression before 'int'
   28 |       v1.y = int.Parse(s[3]) - int.Parse(s[1]);
      |              ^~~
a.cc:29:14: error: expected primary-expression before 'int'
   29 |       v2.x = int.Parse(s[6]) - int.Parse(s[4]);
      |              ^~~
a.cc:30:14: error: expected primary-expression before 'int'
   30 |       v2.y = int.Parse(s[7]) - int.Parse(s[5]);
      |              ^~~
a.cc:33:9: error: 'Console' was not declared in this scope
   33 |         Console.WriteLine("1");
      |         ^~~~~~~
a.cc:35:9: error: 'Console' was not declared in this scope
   35 |         Console.WriteLine("2");
      |         ^~~~~~~
a.cc:37:9: error: 'Console' was not declared in this scope
   37 |         Console.WriteLine("0");
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
class vector {
public:
	double x, y;
	vector(double a, double  b) {
		x = a;
		y = b;
	};
	/*vector operator * (const vector &v)const {
		return vector(x*v.x, y* v.y);
	}
	vector operator - (vector v) {
		return vector(x - v.x, y - v.y);
	}*/
};
inline double dot(vector v1, vector v2) {
	return v1.x*v2.x + v1.y*v2.y;
}
inline double para(vector v1, vector v2) {
	return sqrt(v1.x*v1.x + v1.y*v1.y)*sqrt(v2.x*v2.x + v2.y*v2.y);
}
int main() {
	double n, x1, x2, x3, x4, y1, y2, y3, y4;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		vector v1(x2 - x1, y2 - y1);
		vector v2(x4 - x3, y4 - y3);
		double ans = dot(v1, v2);
		if (ans == 0) cout << 1 << endl;
		else if (ans == para(v1, v2) || ans == -para(v1, v2)) cout << 2 << endl;
		else cout << 0 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'double para(vector, vector)':
a.cc:22:16: error: 'sqrt' was not declared in this scope
   22 |         return sqrt(v1.x*v1.x + v1.y*v1.y)*sqrt(v2.x*v2.x + v2.y*v2.y);
      |                ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)

class Point{
public:
	double x, y;

	Point(double x = 0, double y = 0) :x(x), y(y){}

	Point operator + (Point p){ return Point(x + p.x, y + p.y); }
	Point operator - (Point p){ return Point(x - p.x, y - p.y); }
	Point operator * (Point p){ return Point(x * p.x, y * p.y); }
	Point operator / (Point p){ return Point(x / p.x, y / p.y); }

	double abs(){ return sqrt(norm()); }
	double norm(){ return x * x + y * y; }

	bool operator<(const Point &p){ return (x != p.x) ? (x < p.x) : (y < p.y); }
	bool operator==(const Point &p)
	{
		return equals(x, p.x) && equals(y, p.y);
	}
};

typedef Point Vector;
typedef Point Segment;

double dot(Vector a, Vector b){
	return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b){
	return a.x * b.y - a.y * b.x;
}

bool isOrthogonal(Vector a, Vector b){
	return equals(dot(a, b), 0);
}

bool isOrthogonal(Point a1, Point a2, Point b1, Point b2){
	return isOrthogonal(a1 - a2, b1 - b2);
}

//bool isOrthogonal(Segment s1, Segment s2){
//	return equals(dot(s1.p2 - s1.p1, s2.p2 - s2.p1), 0);
//}

bool isParallel(Vector a, Vector b){
	return equals(cross(a, b), 0);
}

bool isParallel(Point a1, Point a2, Point b1, Point b2){
	return isParallel(a1 - a2, b1 - b2);
}

int main()
{
	int n; cin >> n;
	for (int i = 0; i < n; ++i)
	{
		Point a1, a2, b1, b2;
		cin >> a1.x >> a1.y >> a2.x >> a2.y >> b1.x >> b1.y >> b2.x >> b2.y;
		if (isParallel(a1, a2, b1, b2))
			cout << 2 << endl;
		else if (isOrthogonal(a1, a2, b1, b2))
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
}

Compiler output:
a.cc: In member function 'double Point::abs()':
a.cc:20:30: error: 'sqrt' was not declared in this scope
   20 |         double abs(){ return sqrt(norm()); }
      |                              ^~~~
a.cc: In member function 'bool Point::operator==(const Point&)':
a.cc:7:23: error: 'fabs' was not declared in this scope; did you mean 'abs'?
    7 | #define equals(a, b) (fabs((a)-(b)) < EPS)
      |                       ^~~~
a.cc:26:24: note: in expansion of macro 'equals'
   26 |                 return equals(x, p.x) && equals(y, p.y);
      |                        ^~~~~~
a.cc: In function 'bool isOrthogonal(Vector, Vector)':
a.cc:7:23: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    7 | #define equals(a, b) (fabs((a)-(b)) < EPS)
      |                       ^~~~
a.cc:42:16: note: in expansion of macro 'equals'
   42 |         return equals(dot(a, b), 0);
      |                ^~~~~~
a.cc: In function 'bool isParallel(Vector, Vector)':
a.cc:7:23: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    7 | #define equals(a, b) (fabs((a)-(b)) < EPS)
      |                       ^~~~
a.cc:54:16: note: in expansion of macro 'equals'
   54 |         return equals(cross(a, b), 0);
      |                ^~~~~~