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

#include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;

int main(){
	double x[3],y[3],xp,yp;
	cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp)
		bool ans=true;
		for(int i=0;i<3;i++){
			double gaiseki;
			int k = (i+1)%3;
			double vx,vy,vpx,vpy;
			vx = x[k]-x[i];
			vy = y[k]-y[i];
			vpx = xp-x[i];
			vpy = yp-y[i];
			gaiseki = vx*vpy-vy*vpx;
			if(gaiseki<=0) ans = false;
		}
		if(ans){
			cout << "YES" << endl;
		}else{
				cout << "NO" << endl;
		}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:72: error: expected ';' before ')' token
   10 |         cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp)
      |                                                                        ^
      |                                                                        ;
a.cc:21:40: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |                         if(gaiseki<=0) ans = false;
      |                                        ^~~
      |                                        abs
a.cc:23:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |                 if(ans){
      |                    ^~~
      |                    abs
Language: C++

#include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;

int main(){
	double x[3],y[3],xp,yp;
	cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp
		bool ans=true;
		for(int i=0;i<3;i++){
			double gaiseki;
			int k = (i+1)%3;
			double vx,vy,vpx,vpy;
			vx = x[k]-x[i];
			vy = y[k]-y[i];
			vpx = xp-x[i];
			vpy = yp-y[i];
			gaiseki = vx*vpy-vy*vpx;
			if(gaiseki<=0) ans = false;
		}
		if(ans){
			cout << "YES" << endl;
		}else{
				cout << "NO" << endl;
		}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:72: error: expected ';' before 'bool'
   10 |         cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp
      |                                                                        ^
      |                                                                        ;
   11 |                 bool ans=true;
      |                 ~~~~                                                    
a.cc:21:40: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |                         if(gaiseki<=0) ans = false;
      |                                        ^~~
      |                                        abs
a.cc:23:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |                 if(ans){
      |                    ^~~
      |                    abs
Language: C++

def side(p1, p2)
   #the line from p1(a,b) to p2(c,d). return [e,f,g] where ex+fy=g
   a,b = p1
   c,d = p2
   e = b - d
   f = c - a
   g = b*c - d*a
   return [e,f,g]
end

def between?(p1, p2, p3, q)
   #Is q between p1 ~ line from p2 to p3?
   a,b,c = side(p2,p3)
   dist_array = [p1, q].map{|point| (point[0]*a + point[1]*b - c).abs }
   if dist_array[0] > dist_array[1]
	  return true
   else
	  return false
   end
end

while num = gets
   a,b,c,d,e,f,g,h= num.split(' ').map(&:to_f)
   p1, p2, p3, q = [a,b],[c,d],[e,f],[g,h]
   if between?(p1, p2, p3, q) && between?(p2, p3, p1, q) && between?(p3, p1, p2, q)
	  puts "YES"
   else
	  puts "NO"
   end
end

Compiler output:
a.cc:2:5: error: invalid preprocessing directive #the
    2 |    #the line from p1(a,b) to p2(c,d). return [e,f,g] where ex+fy=g
      |     ^~~
a.cc:12:5: error: invalid preprocessing directive #Is
   12 |    #Is q between p1 ~ line from p2 to p3?
      |     ^~
a.cc:1:1: error: 'def' does not name a type
    1 | def side(p1, p2)
      | ^~~
a.cc:15:4: error: expected unqualified-id before 'if'
   15 |    if dist_array[0] > dist_array[1]
      |    ^~
Language: C++

import java.util.*;
public class Main{
  private static String a;
  static double xp,yp,z,x1,y1;
  public static double[] w(double[] x, double[] y) {
	  x[2] = -x[2];
	  y[2] = -y[2];
	  z = (x[0] * y[1] )- (x[1] * y[0]);
	  x1 = +(y[1] * x[2]) - (x[1] * y[2]);
	  y1 = +(x[0] * y[2]) - (y[0] * x[2]);
	  return new double[] { (x1 / z), (y1 / z) };
	}
public static void main(String [] args){
	  Scanner cs = new Scanner(System.in);
	  double[] x = new double[3];
	  double[] y = new double[3];
	  while (cs.hasNextDouble()) {  {
	      for (int i = 0; i < 3; i++) {
	        x[i] = cs.nextDouble();
	        y[i] = cs.nextDouble();
	      }
	       xp = cs.nextDouble();
	       yp = cs.nextDouble();
	      for (int i = 0; i < 3; i++) {
	        x[i] -= xp;
	        y[i] -= yp;
	      }
	    }
	    double[] X = w(x, y);
	    if (X[0] >= 0 && X[1] >= 0) System.out.println("YES");
	   else System.out.println("NO");
	    }
	  }
	
	}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main{
      | ^~~~~~
Language: C++

#include <stdio.h>
using namespace std;
int main(){
double px,py;
double tx[3],ty[3];
bool flag;
bool v[3];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tx[0],&ty[0],&tx[1],&ty[1],&tx[2],&ty[2],&px,&py) == 8){
for(int i=0;i<3;i++){
tx[i]=tx[i]-px;
ty[i]=ty[i]-py;
}
//t[i]→t[i+1]のベクトルに対してt[i]→(px,py)のベクトルが同じ方向を向いているかを判定する
//t[i]を90度回転させたベクトルとの内積で求める
for(int i=0;i<3;i++){
if((tx[i%3]*ty[(i+1)%3])-(ty[i%3]*tx[(i+1)%3])<0){
v[i]=true;
}else{
v[i]=false;
}
}
if(v[0]!=v[1]){
cout<<"NO"<<endl;
}else if(v[1]!=v[2]){
cout<<"NO"<<endl;
}else {
cout<<"YES"<<endl;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:1: error: 'cout' was not declared in this scope
   23 | cout<<"NO"<<endl;
      | ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:23:13: error: 'endl' was not declared in this scope
   23 | cout<<"NO"<<endl;
      |             ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:25:1: error: 'cout' was not declared in this scope
   25 | cout<<"NO"<<endl;
      | ^~~~
a.cc:25:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:13: error: 'endl' was not declared in this scope
   25 | cout<<"NO"<<endl;
      |             ^~~~
a.cc:25:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:27:1: error: 'cout' was not declared in this scope
   27 | cout<<"YES"<<endl;
      | ^~~~
a.cc:27:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:14: error: 'endl' was not declared in this scope
   27 | cout<<"YES"<<endl;
      |              ^~~~
a.cc:27:14: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <stdio.h>
using namespace std;
int main(){
double px,py;
double tx[3],ty[3];
bool flag;
bool v[3];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tx[0],&ty[0],&tx[1],&ty[1],&tx[2],&ty[2],&px,&py) == 8){
for(int i=0;i<3;i++){
tx[i]=tx[i]-px;
ty[i]=ty[i]-py;
}
for(int i=0;i<3;i++){
if((tx[i%3]*ty[(i+1)%3])-(ty[i%3]*tx[(i+1)%3])<0){
v[i]=true;
}else{
v[i]=false;
}
}
if(v[0]!=v[1]){
cout<<"NO"<<endl;
}else if(v[1]!=v[2]){
cout<<"NO"<<endl;
}else {
cout<<"YES"<<endl;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:1: error: 'cout' was not declared in this scope
   21 | cout<<"NO"<<endl;
      | ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:21:13: error: 'endl' was not declared in this scope
   21 | cout<<"NO"<<endl;
      |             ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:23:1: error: 'cout' was not declared in this scope
   23 | cout<<"NO"<<endl;
      | ^~~~
a.cc:23:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:13: error: 'endl' was not declared in this scope
   23 | cout<<"NO"<<endl;
      |             ^~~~
a.cc:23:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:25:1: error: 'cout' was not declared in this scope
   25 | cout<<"YES"<<endl;
      | ^~~~
a.cc:25:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:14: error: 'endl' was not declared in this scope
   25 | cout<<"YES"<<endl;
      |              ^~~~
a.cc:25:14: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

double dot(P a,P b){return real(conj(a)*b)};
double cross(P a,P b){return imag(conj(a)*b)};

int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)){
    P a(x1,y1), b(x2,y2), c(x3,y3), p(xp,yp);
    double cra = cross(b-a,p-a);
    double crb = cross(c-b,p-b);
    double crc = cross(a-c,p-c);
    if(cra<0){
      cra*=-1;
      crb*=-1;
      crc*=-1;
    }
    if(cra>0 && crb>0 && crc>0){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'double dot(P, P)':
a.cc:22:43: error: expected ';' before '}' token
   22 | double dot(P a,P b){return real(conj(a)*b)};
      |                                           ^
      |                                           ;
a.cc: In function 'double cross(P, P)':
a.cc:23:45: error: expected ';' before '}' token
   23 | double cross(P a,P b){return imag(conj(a)*b)};
      |                                             ^
      |                                             ;
Language: C++

$ cat A_point_in_a_triangle.cpp
#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

Compiler output:
a.cc:2:9: fatal error: bits\stdc++.h: No such file or directory
    2 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;
return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
struct Point { long double px, py; };
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double norm(Point a) { return a.x*a.x + a.y*a.y; }
Point Minus(Point p1, Point p2) {
	Point A1; 
	A1.px = p1.px - p2.px;
	A1.py = p1.py - p2.py;
	return A1;
}
int ccw(Point p0, Point p1, Point p2) {
	Point a = Minus(p1, p0), b = Minus(p2, p0);
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
bool its(Point p1, Point p2, Point p3, Point p4) {
	return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 && ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}
Point P1, P2, P3, P4;
int main() {
	while (cin >> P1.px >> P1.py >> P2.px >> P2.py >> P3.px >> P3.py >> P4.px >> P4.py) {
		int OK = 0;
		if (its(P1, P2, P3, P4) == true) { OK = 1; }
		if (its(P1, P3, P2, P4) == true) { OK = 1; }
		if (its(P1, P4, P2, P3) == true) { OK = 1; }
		if (OK == 1) { cout << "NO" << endl; }
		else { cout << "YES" << endl; }
	}
}

Compiler output:
a.cc: In function 'long double norm(Point)':
a.cc:6:38: error: 'struct Point' has no member named 'x'; did you mean 'px'?
    6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
      |                                      ^
      |                                      px
a.cc:6:42: error: 'struct Point' has no member named 'x'; did you mean 'px'?
    6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
      |                                          ^
      |                                          px
a.cc:6:48: error: 'struct Point' has no member named 'y'; did you mean 'py'?
    6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
      |                                                ^
      |                                                py
a.cc:6:52: error: 'struct Point' has no member named 'y'; did you mean 'py'?
    6 | long double norm(Point a) { return a.x*a.x + a.y*a.y; }
      |                                                    ^
      |                                                    py
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){

  double x1, y1, x2, y2, x3, y3, xp, yp;

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){

    double a = x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2);
    double b = x*(y1 - y2) + x1*(y2 - y) + x2*(y - y1);
    double c = x*(y2 - y3) + x2*(y3 - y) + x3*(y - y2);
    double d = x*(y3 - y1) + x3*(y1 - y) + x1*(y - y3);

    if((a<0 && b<0 && c<0 && d<0) || (a>0 && b>0 && c>0 && d>0))
      puts("YES");
    else puts("NO");

  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'x' was not declared in this scope
   11 |     double b = x*(y1 - y2) + x1*(y2 - y) + x2*(y - y1);
      |                ^
a.cc:11:39: error: 'y' was not declared in this scope
   11 |     double b = x*(y1 - y2) + x1*(y2 - y) + x2*(y - y1);
      |                                       ^
Language: C++

using namespace std;
typedef complex<double> xy_t;
xy_t a, b, c, p;
double x1, x2, x3, xp, y_1, y2, y3, yp;
double s1, s2, s3;
int main()
{
	while(cin >> x1 >> y_1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
	{
		a=xy_t(x1, y_1);
		b=xy_t(x2, y2);
		c=xy_t(x3, y3);
		p=xy_t(xp, yp);
		s1=(conj(a-p)*(b-p)).imag();
		s2=(conj(b-p)*(c-p)).imag();
		s3=(conj(c-p)*(a-p)).imag();
		if(((s1>0)&&(s2>0)&&(s3>0))||((s1<0)&&(s2<0)&&(s3<0)))
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:2:9: error: 'complex' does not name a type
    2 | typedef complex<double> xy_t;
      |         ^~~~~~~
a.cc:3:1: error: 'xy_t' does not name a type
    3 | xy_t a, b, c, p;
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:15: error: 'cin' was not declared in this scope
    8 |         while(cin >> x1 >> y_1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
      |               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:17: error: 'a' was not declared in this scope
   10 |                 a=xy_t(x1, y_1);
      |                 ^
a.cc:10:19: error: 'xy_t' was not declared in this scope
   10 |                 a=xy_t(x1, y_1);
      |                   ^~~~
a.cc:11:17: error: 'b' was not declared in this scope
   11 |                 b=xy_t(x2, y2);
      |                 ^
a.cc:12:17: error: 'c' was not declared in this scope
   12 |                 c=xy_t(x3, y3);
      |                 ^
a.cc:13:17: error: 'p' was not declared in this scope; did you mean 'yp'?
   13 |                 p=xy_t(xp, yp);
      |                 ^
      |                 yp
a.cc:14:21: error: 'conj' was not declared in this scope
   14 |                 s1=(conj(a-p)*(b-p)).imag();
      |                     ^~~~
a.cc:19:25: error: 'cout' was not declared in this scope
   19 |                         cout << "YES" << endl;
      |                         ^~~~
a.cc:19:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:42: error: 'endl' was not declared in this scope
   19 |                         cout << "YES" << endl;
      |                                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:23:25: error: 'cout' was not declared in this scope
   23 |                         cout << "NO" << endl;
      |                         ^~~~
a.cc:23:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:41: error: 'endl' was not declared in this scope
   23 |                         cout << "NO" << endl;
      |                                         ^~~~
a.cc:23:41: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
#include<complex>
#include<cmath>
#include<queue>
using namespace std;
typedef complex<double> xy_t;
double cross_product(xy_t p,xy_t q);
{
  return (conj(p)*q).imag();
}
int main()
{
  double x[4],y[4];
  while(true){
    for( int i = 0; i < 4; ++i) cin >> x[i] >> y[i];
    if(!cin) break;
    xy_t a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]),p(x[3],y[3]);
    double S1,S2,S3;
    S1 = cross_product(a - p, b - p);
    S2 = cross_product(b - p, c - p);
    S3 = cross_product(c - p, a - p);
    bool ok = (S1 > 0 && S2 > 0 && S3 > 0) || (S1 < 0 && S2 < 0 && S3 < 0);
    cout << (ok ? "YES":"NO") << endl;
  }
}

Compiler output:
a.cc:8:1: error: expected unqualified-id before '{' token
    8 | {
      | ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
double x[4],y[4],r[3];
void che(a,b){
	if(x[a]>x[b]){
		swap(x[a],x[b]);
		swap(y[a],y[b]);
	}
}
int main(){
	int m=0;
	while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3]){
		che(0,1);
		che(1,2);
		che(0,1);
		if(y[0]<=y[3] && y[3]<=y[1]){
			r[0]=x[0]+(x[2]-x[0])*(y[3]-y[0])/(y[2]-y[0]);
			r[1]=x[0]+(x[1]-x[0])*(y[3]-y[0])/(y[1]-y[0]);
			if(r[0]>r[1])swap(r[0],r[1]);
		}else if(y[1]<=y[3] && y[3]<=y[2]){
			r[0]=x[2]+(x[0]-x[2])*(y[2]-y[3])/(y[2]-y[0]);
			r[1]=x[2]+(x[1]-x[2])*(y[2]-y[3])/(y[2]-y[1]);
			if(r[0]>r[1])swap(r[0],r[1]);
		}else{
			cout<<"NO"<<endl;
			continue;
		}
		if(r[0]<=x[3] && x[3]<=r[1]){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:5:6: error: variable or field 'che' declared void
    5 | void che(a,b){
      |      ^~~
a.cc:5:10: error: 'a' was not declared in this scope
    5 | void che(a,b){
      |          ^
a.cc:5:12: error: 'b' was not declared in this scope
    5 | void che(a,b){
      |            ^
a.cc: In function 'int main()':
a.cc:14:17: error: 'che' was not declared in this scope
   14 |                 che(0,1);
      |                 ^~~
Language: C++

#include<iostream>
using namespace std;
double cross(double x1, double y1, double x2, double y2){
	return (x1 * y2) - (y1 * x2);
}
int main(){
	double x[3], y[3], x, y;
	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
		double ret[3];
		for(int i = 0; i < 3; ++i ){
			int n =( i+1 ) % 3;
			ret[i] = cross( px - x[i], py - y[i], x[n] - x[i], y[n] - y[i] );
		}
		if(ret[0] < 0 && ret[1] < 0 && ret[2] < 0 
		|| ret[0] > 0 && ret[1] > 0 && ret[2] > 0) 
			cout << "YES" << endl;
		else
		    cout << "NO" << endl;		
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: conflicting declaration 'double x'
    7 |         double x[3], y[3], x, y;
      |                            ^
a.cc:7:16: note: previous declaration as 'double x [3]'
    7 |         double x[3], y[3], x, y;
      |                ^
a.cc:7:31: error: conflicting declaration 'double y'
    7 |         double x[3], y[3], x, y;
      |                               ^
a.cc:7:22: note: previous declaration as 'double y [3]'
    7 |         double x[3], y[3], x, y;
      |                      ^
a.cc:8:70: error: 'px' was not declared in this scope; did you mean 'x'?
    8 |         while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
      |                                                                      ^~
      |                                                                      x
a.cc:8:76: error: 'py' was not declared in this scope; did you mean 'y'?
    8 |         while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
      |                                                                            ^~
      |                                                                            y
Language: C++

#include <iostream>
using namespace std;

class point{ // as necessary
	private:
		static const double EPS=1e-5;
	public:
		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;

		double x;
		double 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*(const double a){return point(x*a,y*a);}
		point operator/(const double a){return point(x/a,y/a);}

		static double dot(const point &p1,const point &p2){
			return p1.x*p2.x+p1.y*p2.y;
		}

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

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

		static double cross(point p1,point p2){
			return p1.x*p2.y-p1.y*p2.x;
		}

		static int ccw(point p0,point p1,point p2){
			point a=p1-p0; // ??????p0p1
			point b=p2-p0; // ??????p0p2
			if(cross(a,b)>EPS) return COUNTER_CLOCKWISE; // a????????????b??????????¨?
			if(cross(a,b)<-EPS) return CLOCKWISE; // a????????????b???????¨?
			if(dot(a,b)<-EPS) return ONLINE_BACK; // p2-p0-p1???????????¢???
			if(a.norm(),b.norm()) return ONLINE_FRONT; // p0-p1-p2???????????¢???
			return ON_SEGMENT; // p0-p2-p1???????????¢???
		}
};

int main(void){
	double x,y;
	while(cin>>x>>y){
		int rcw=0;
		int cw=0;
		point a(x,y);
		cin>>x>>y;
		point b(x,y);
		cin>>x>>y;
		point c(x,y);
		cin>>x>>y;
		point d(x,y);
		switch(point::ccw(d,a,b)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(d,b,c)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(d,c,a)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		if(rcw==1&&cw==2)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}

Compiler output:
a.cc:6:37: error: 'constexpr' needed for in-class initialization of static data member 'const double point::EPS' of non-integral type [-fpermissive]
    6 |                 static const double EPS=1e-5;
      |                                     ^~~
a.cc: In member function 'double point::abs()':
a.cc:32:32: error: 'sqrt' was not declared in this scope
   32 |                         return sqrt(norm());
      |                                ^~~~
Language: C++

#include <iostream>
using namespace std;

struct TPoint
{
	double x;
	double y;
};

double GetCrossProduct(const TPoint& V1, const TPoint& V2)
{
	return V1.x * V2.y - V1.y * V2.x;
}

double Vector(const TPoint& P1, const TPoint& P2)
{
	return {P2.x - P1.x, P2.y - P1.y};
}

bool IsSameSide(const TPoint& P1, const TPoint& P2, const TPoint& L1, const TPoint& L2)
{
	return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
}

int main()
{
	while(true){
		TPoint A1, A2, A3, Ap;
		cin >> A1.x >> A1.y >> A2.x >> A2.y >> A3.x >> A3.y >> Ap.x >> Ap.y;
		if(cin.eof() == true) break;
		if(IsSameSide(A3, Ap, A1, A2) && IsSameSide(A1, Ap, A2, A3) && IsSameSide(A2, Ap, A3, A1)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'double Vector(const TPoint&, const TPoint&)':
a.cc:17:41: error: cannot convert '<brace-enclosed initializer list>' to 'double' in return
   17 |         return {P2.x - P1.x, P2.y - P1.y};
      |                                         ^
a.cc: In function 'bool IsSameSide(const TPoint&, const TPoint&, const TPoint&, const TPoint&)':
a.cc:22:38: error: invalid initialization of reference of type 'const TPoint&' from expression of type 'double'
   22 |         return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
      |                                ~~~~~~^~~~~~~~
a.cc:10:38: note: in passing argument 1 of 'double GetCrossProduct(const TPoint&, const TPoint&)'
   10 | double GetCrossProduct(const TPoint& V1, const TPoint& V2)
      |                        ~~~~~~~~~~~~~~^~
a.cc:22:88: error: invalid initialization of reference of type 'const TPoint&' from expression of type 'double'
   22 |         return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
      |                                                                                  ~~~~~~^~~~~~~~
a.cc:10:38: note: in passing argument 1 of 'double GetCrossProduct(const TPoint&, const TPoint&)'
   10 | double GetCrossProduct(const TPoint& V1, const TPoint& V2)
      |                        ~~~~~~~~~~~~~~^~
Language: C++

#include<iostream>
using namespace std;
int main()
double x
{
double x1,y1,x2,y2,x3,y3,xp,yp;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
{
	if(y1<y2&&y3<y2)
	{
	for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)<(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
cout<<"YES"<<endl;
break;	
}
}
else if(y1>y2&&y1>y1)
{
for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)<(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
cout<<"YES"<<endl;
break;	
	}	
	}	
}
else if(y3>y1&&y3>y2)
{
	for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)<(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
cout<<"YES"<<endl;
break;
}
else
{
	cout<<"NO"<<endl;
}
return 0;
}

Compiler output:
a.cc:4:1: error: expected initializer before 'double'
    4 | double x
      | ^~~~~~
Language: C++

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String args[])throws Exception{
        Scanner cin= new Scanner(System.in);
		
		while(cin.hasNextDouble()){
			double in[] = new double[8];
			for(int i=0;i<8;i++) in[i]= cin.nextDouble();
			int t1,t2,t3;
			t1= java.awt.geom.Line2D.relativeCCW(in[0],in[1],in[2],in[3],in[6],in[7]);
			t2= java.awt.geom.Line2D.relativeCCW(in[2],in[3],in[4],in[5],in[6],in[7]);
			t3= java.awt.geom.Line2D.relativeCCW(in[4],in[5],in[0],in[1],in[6],in[7]);
			if((t1==1 && t2==1 && t3==1) || (t1==-1 && t2==-1 && t3==-1)) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;

class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		
		while (true)
		{
			double x1, y1, x2, y2, x3, y3, xp, yp;
			try
			{
				x1 = sc.nextDouble();
				y1 = sc.nextDouble();
				x2 = sc.nextDouble();
				y2 = sc.nextDouble();
				x3 = sc.nextDouble();
				y3 = sc.nextDouble();
				xp = sc.nextDouble();
				yp = sc.nextDouble();
			}
			catch (Exception e)
			{
				break;
			}
			
			if (!((f(x1, y1, x2, y2, x3) < y3 && f(x1, y1, x2, y2, xp) < yp)
				|| (f(x1, y1, x2, y2, x3) > y3 && f(x1, y1, x2, y2, xp) > yp)
			)) {
				System.out.println("NO");
				continue;
			}
			if (!((f(x2, y2, x3, y3, x1) < y1 && f(x2, y2, x3, y3, xp) < yp)
				|| (f(x2, y2, x3, y3, x1) > y1 && f(x2, y2, x3, y3, xp) > yp)
			)) {
				System.out.println("NO");
				continue;
			}
			if (!((f(x3, y3, x1, y1, x2) < y2 && f(x3, y3, x1, y1, xp) < yp)
				|| (f(x3, y3, x1, y1, x2) > y2 && f(x3, y3, x1, y1, xp) > yp)
			)) {
				System.out.println("NO");
				continue;
			}
			System.out.println("YES");
		}
	}
	private static double f(double x1, double y1, double x2, double y2, double x)
	{
		return (y1 - y2) / (x1 - x2) * (x - x1) + y1;
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main(String args[])
      |               ^~~~~~~
      |               :
a.cc:5:33: error: 'String' has not been declared
    5 |         public static void main(String args[])
      |                                 ^~~~~~
a.cc:49:16: error: expected ':' before 'static'
   49 |         private static double f(double x1, double y1, double x2, double y2, double x)
      |                ^~~~~~~
      |                :
a.cc:53:2: error: expected ';' after class definition
   53 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:7:17: error: 'Scanner' was not declared in this scope
    7 |                 Scanner sc = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:14:38: error: 'sc' was not declared in this scope
   14 |                                 x1 = sc.nextDouble();
      |                                      ^~
a.cc:23:32: error: 'Exception' does not name a type
   23 |                         catch (Exception e)
      |                                ^~~~~~~~~
a.cc:31:33: error: 'System' was not declared in this scope
   31 |                                 System.out.println("NO");
      |                                 ^~~~~~
a.cc:37:33: error: 'System' was not declared in this scope
   37 |                                 System.out.println("NO");
      |                                 ^~~~~~
a.cc:43:33: error: 'System' was not declared in this scope
   43 |                                 System.out.println("NO");
      |                                 ^~~~~~
a.cc:46:25: error: 'System' was not declared in this scope
   46 |                         System.out.println("YES");
      |                         ^~~~~~
Language: C++

#include <iostream>
#include <cmath>
#define mul(s, t) ((s-t)*(s-t))

using namespace std;

int main()
{
	double x[3], y[3], u[2], s, t, v;
	
	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> s >> t){
		bool f = true;
		for(int i = 0; i < 3; i++){
			int p = 0;
			for(int j = 0; j < 3; j++){
				if(i != j){
					u[p++] = sqrt(mul(x[i], x[j])+mul(y[i], y[j]));
				}
			}
			v = sqrt(mul(x[i], s)+mul(y[i], t));
			
			if(u[0] =< v || u[1] =< v){
				f = false;
				break;
			}
		}
		cout << ((f)? "YES" : "NO") << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: expected primary-expression before '<' token
   22 |                         if(u[0] =< v || u[1] =< v){
      |                                  ^
a.cc:22:47: error: expected primary-expression before '<' token
   22 |                         if(u[0] =< v || u[1] =< v){
      |                                               ^
Language: C++

#include <iostream>
using namespace std;
double x[4],y[4],px,py,ax,ay,bx,by;
int main()
{
	while(true)
	{
		for(int i = 1;i<=3;i++){cin >> x[i];cin >> y[i];}
		if(cin.eof()){break;}
		cin >> px;
		cin >> py;
		double m,n;
		ax = x[2]-x[1];
		ay = y[2]-y[1];
		bx = x[3]-x[1];
		by = y[3]-y[1];
		double det = ax*by-ay*bx;
		m = (by*px-bx*py)/det;
		n = (-ay*px+ax*py)/det;
		if(m>0 && m < 1 && n > 0 && n < 1 && m+n < 1 ) {cout << "YES" << endl;}
		else {cout << "NO" << endl};
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:43: error: expected ';' before '}' token
   21 |                 else {cout << "NO" << endl};
      |                                           ^
      |                                           ;
Language: C++

#include <iostream>
#include <cstdlib>
using namespace std;

int main(){
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		double sall = (x1-x2)*(y1+y2) + (x2-x3)*(y2+y3) + (x3-x1)*(y3+y1);
		double s1 = (x1-x2)*(y1+y2) + (x2-xp)*(y2+yp) + (xp-x1)*(yp+y1);
		double s2 = (x1-xp)*(y1+yp) + (xp-x3)*(yp+y3) + (x3-x1)*(y3+y1);
		double s3 = (xp-x2)*(yp+y2) + (x2-x3)*(y2+y3) + (x3-xp)*(y3+yp);
		if(fabs(sall) == fabs(s1)+fabs(s2)+fabs(s3)){
			cout<<"YES"<<endl;
		} else {
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   12 |                 if(fabs(sall) == fabs(s1)+fabs(s2)+fabs(s3)){
      |                    ^~~~
      |                    labs
Language: C++

#include <iostream>
#include <algorithm>

#include <utility>
using namespace std;


pair<double,double> tp[3];
pair<double,double> p;
bool flag=true;


int main(){
	
	
	
	
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tp[0].first,&tp[0].second,&tp[1].first,&tp[1].second,&tp[2].first,&tp[2].second,&p.first,&p.second) == 8){
		flag=true;
		
		for(int i=0;i<3;i++){
					
			if (tp[i%3].second-tp[(i+1)%3].second==0){
				if(
					(p.second-tp[i%3].second)
					*(tp[(i+2)%2].second-tp[i%3].second)
					<0
				)flag=false;
			}else {
				printf("%lf\n",
					(p.second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(p.first-tp[i%3].first)+tp[i%3].second)
					*(tp[(i+2)%2].second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(tp[(i+2)%2].first-tp[i%3].first)+tp[i%3].second));
				if(
					(p.second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(p.first-tp[i%3].first)+tp[i%3].second)
					*(tp[(i+2)%2].second - (tp[i%3].first-tp[(i+1)%3].first)/(tp[i%3].second-tp[(i+1)%3].second)*(tp[(i+2)%2].first-tp[i%3].first)+tp[i%3].second)
					<0
				)flag=false;
			}
		}
		
		
		
		
		if(flag)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
		
	}
	return 0;
}
　

Compiler output:
a.cc:50:1: error: extended character 　 is not valid in an identifier
   50 | 　
      | ^
a.cc:50:1: error: '\U00003000' does not name a type
   50 | 　
      | ^~
Language: C++

#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>

using namespace std;

double EPS = 1e-10;

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);
  }
};

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);
}

int is_point_on_line(point a, point b, point c) {
  return cross(b-a, c-a)==0.0 &&
         (dot(b-a, c-a) > -EPS) &&
         (dot(a-b, c-b) > -EPS);
}

int is_intersected_ls(point a1, point a2, point b1, point b2) {

  if(cross(a1-a2,b1-b2)==0){
    return is_point_on_line(a1,a2,b1) || is_point_on_line(a1,a2,b2) 
        || is_point_on_line(b1,b2,a1) || is_point_on_line(b1,b2,a2);
  }
  else {
    return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
           ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
  }
}

int inside(point p, vector<point> ps){
  point a,b;
  a=b=p;

  b.x=1000000;

  int n=ps.size();
  ps.push_back(ps[0]);

  if(a.y<=ymn||a.y>=ymx)return 0;
  
  for(int i=0;i<n;i++){
    if(is_point_on_line(ps[i],ps[i+1],p))return 0;
  }
  
  int cnt1=0;
  for(int i=0;i<n;i++)
    if(is_point_on_line(a,b,ps[i]))cnt1++;
  
  int cnt=0;
  for(int i=0;i<n;i++)
    if(is_intersected_ls(ps[i],ps[i+1],a,b))cnt++;
  
  return (cnt-cnt1)%2;
}

int main(void){
 
  point in[4],p;
  vector<point>ps;

  while(cin>>in[1].x>>in[1].y>>in[2].x>>in[2].y>>in[3].x>>in[3].y>>p.x>>p.y){

    ps.clear();

    for(int i=1;i<4;i++)
    ps.push_back(in[i]);

    if(inside(p,ps))cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int inside(point, std::vector<point>)':
a.cc:70:11: error: 'ymn' was not declared in this scope; did you mean 'yn'?
   70 |   if(a.y<=ymn||a.y>=ymx)return 0;
      |           ^~~
      |           yn
a.cc:70:21: error: 'ymx' was not declared in this scope
   70 |   if(a.y<=ymn||a.y>=ymx)return 0;
      |                     ^~~
Language: C++

struct Vec2 {
  double x, y;
  Vec2(double x_, double y_) : x(x_), y(y_) {}
};

bool in_the_triangle(const Vec2& a, const Vec2& b, const Vec2& c, const Vec2& p) {
  Vec2 aa(a.x-p.x, a.y-p.y);
  Vec2 bb(b.x-p.x, b.y-p.y);
  Vec2 cc(c.x-p.x, c.y-p.y);
  double k = aa.x*bb.y - bb.x*aa.y;
  double l = bb.x*cc.y - cc.x*bb.y;
  double m = cc.x*aa.y - aa.x*cc.y;
  return (k * l > 0 && k * m > 0);
}

int main() {
double a,b,c,d,e,f,g,h;
while (scanf("%f%f%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f,&g,&h)) {
  puts(in_the_triangle(Vec2(a,b),Vec2(c,d),Vec2(e,f),Vec2(g,h)) ? "YES" : "NO");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'scanf' was not declared in this scope
   18 | while (scanf("%f%f%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f,&g,&h)) {
      |        ^~~~~
a.cc:19:3: error: 'puts' was not declared in this scope
   19 |   puts(in_the_triangle(Vec2(a,b),Vec2(c,d),Vec2(e,f),Vec2(g,h)) ? "YES" : "NO");
      |   ^~~~
Language: C++

/*problem C*/

#include<stdio.h>

typedef struct{
	double x,y;
}point_obj;

int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
	return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main(){
	point_obj p[5];
	int i,j;
	p[3].x=0;
	p[3].y=0;

	while(cin>>p[0].x){
		cin>>p[0].y;

		p[3].x=p[0].x;
		p[3].y=p[0].y;

		for(int i=0;i<3;i++){
			cin>>p[i].x,cin>>p[i].y;

		p[3].x+=p[i].x;
		p[3].y+=p[i].y;
		}
			p[3].x+=p[0].x;
			p[3].y+=p[0].y;
	
			p[3].x/=3.0;
			p[3].y/=3.0;

			if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
				isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
				isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){

				printf("YES");
			}

			else{
				printf("NO");
			}
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'cin' was not declared in this scope
   19 |         while(cin>>p[0].x){
      |               ^~~
a.cc: At global scope:
a.cc:50:9: error: expected unqualified-id before 'return'
   50 |         return 0;
      |         ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

/*problem C*/

#include <iostream>
using namespace std;

typedef struct{
	double x,y;
}point_obj;

int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
	return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main(){
	point_obj p[5];
	int i,j;
	p[3].x=0;
	p[3].y=0;

	while(cin>>p[0].x){
		cin>>p[0].y;

		p[3].x=p[0].x;
		p[3].y=p[0].y;

		for(int i=0;i<3;i++){
			cin>>p[i].x,cin>>p[i].y;

		p[3].x+=p[i].x;
		p[3].y+=p[i].y;
		}
			p[3].x+=p[0].x;
			p[3].y+=p[0].y;
	
			p[3].x/=3.0;
			p[3].y/=3.0;

			if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
				isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
				isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){

				printf("YES");
			}

			else{
				printf("NO");
			}
		}
	}
	
	return 0;
}

Compiler output:
a.cc:51:9: error: expected unqualified-id before 'return'
   51 |         return 0;
      |         ^~~~~~
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++



    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        pair<double, double> a, b, p;
        a.first = x2 - x1;
        a.second = y2 - y1;
        b.first = x3 - x1;
        b.second = y3 - y1;
        p.first = xp - x1;
        p.second = yp - y1;
        double theta = angle(a, b);
        double phi = angle(a, p);
        double psi = angle(b, p);
        
        if (norm(p) > norm(a) || norm(p) > norm(b)) {
            anslist.push_back("NO");
            break;
        }
        if (phi > theta || psi > theta) {
            anslist.push_back("NO");
            break;
        }
        anslist.push_back("YES");
    }

    for(auto ans : anslist) {
        cout << ans << endl;
    }

    return 0;
}

Compiler output:
a.cc:3:16: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
    3 |     double x1, y1, x2, y2, x3, y3, xp, yp;
      |                ^~
a.cc:4:5: error: expected unqualified-id before 'while'
    4 |     while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
      |     ^~~~~
a.cc:27:5: error: expected unqualified-id before 'for'
   27 |     for(auto ans : anslist) {
      |     ^~~
a.cc:31:5: error: expected unqualified-id before 'return'
   31 |     return 0;
      |     ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>

using namespace std;

#define EPS 1e-10

struct point{
	double x;
	double y;
};
struct line{
	double a; // 傾き
	double b; // 切片
};

int recog_point_place( const point& a , const point&b , const point& c );
bool get_line( const point& a , const point& b , line *a_b );

int main(void)
{
	point a, b, c, p;
	int num_of_data;

	while( scanf("%d", &num_of_data ) != EOF )
	{
		cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> p.x >> p.y;

		int result_ab_c = recog_point_place( a , b , c );
		int result_ab_p = recog_point_place( a , b , p );
		int result_bc_a = recog_point_place( b , c , a );
		int result_bc_p = recog_point_place( b , c , p );
		int result_ca_b = recog_point_place( c , a , b );
		int result_ca_p = recog_point_place( c , a , p );

		if( result_ab_c == result_ab_p && result_bc_a == result_bc_p && result_ca_b == result_ca_p ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

int recog_point_place( const point& a , const point&b , const point& c )
{
	line a_b;

	bool result = get_line( a , b , &a_b );
	if( result == false )
	{
		if( (a.x + b.x)/2 < c.x ) return 1; // 点が直線より右にある場合に1をリターン
		else return 0;
	}
	else if( result == true )
	{
		if( c.y > a_b.a * c.x + a_b.b ) return 1; // 点が直線より上にある場合に1をリターン
		else return 0;
	}

}

bool get_line( const point& a , const point& b , line *a_b )
{
	if( fabs(a.x - b.x) < EPS )
	{
		return false;
	}
	else
	{
		a_b->a = (a.y - b.y) / (a.x - b.x);
		a_b->b = a.y - a_b->a * a.x;

		return true;
	}
}

Compiler output:
a.cc: In function 'bool get_line(const point&, const point&, line*)':
a.cc:63:13: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   63 |         if( fabs(a.x - b.x) < EPS )
      |             ^~~~
      |             labs
a.cc: In function 'int recog_point_place(const point&, const point&, const point&)':
a.cc:59:1: warning: control reaches end of non-void function [-Wreturn-type]
   59 | }
      | ^
a.cc: In function 'bool get_line(const point&, const point&, line*)':
a.cc:74:1: warning: control reaches end of non-void function [-Wreturn-type]
   74 | }
      | ^