Language: C++

#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>

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

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

struct segment{ point a,b; };

struct circle{ point p; double r; };

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 ccw(point p0, point p1, point p2){
  point a = p1 - p0;
  point b = p2 - p0;
  if(cross(a,b)>EPS)return +1;
  if(cross(a,b)<EPS)return -1;
  if(dot(a,b)<-EPS)return +2;
  if(a.x*a.x+a.y*a.y<b.x*b.x+b.y*b.y)return -2;
  return 0;
}

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

double distance_ls_p(point a, point b, point c) {
  if ( dot(b-a, c-a) < EPS ) return vec_abs(c-a);
  if ( dot(a-b, c-b) < EPS ) return vec_abs(c-b);
  return abs(cross(b-a, c-a)) / vec_abs(b-a);
}

double dist(point a,point b){
  return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}

int is_intersected_ls(point a1, point a2, point b1, point b2) {
  return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
         ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

int crossCS(point a, point b, circle c){
  double res=distance_ls_p(a,b,c.p);
  double ac=dist(a,c.p);
  double bc=dist(b,c.p);

  if(res>c.r || (ac<c.r && bc<c.r))return 0;
  else if(c.r-res<EPS ||(ac<c.r && bc>=c.r)||(ac>=c.r && bc<c.r))return 1;
  else return 2;
}

int inside(point t,point* p,int N){
  int i,count=0,j=0;
  segment lt,lp;

  p[N]=p[0];
  p[N+1]=p[1];

  lt.a=lt.b=t;
  lt.b.x=INT_MAX;

  for(i=1;i<=N;i++){
    lp.a=lp.b=p[i];

    if(!is_intersected_ls(lp.a,lp.b,lt.a,lt.b)){
      if(i==j+1){
	lp.b=p[j];
	if(is_intersected_ls(lp.a,lp.b,lt.a,lt.b))count++;
      }
      else if(ccw(lt.a,lt.b,p[i])*ccw(lt.a,lt.b,p[j])<0)count++;
      j=i;
    }
  }
  return count & 1;
}

int crossCP(point* ps, circle C, int sz){

  double ans=0;

  for(int i=0;i<sz;i++){
    double tmp=dist(ps[i],C.p);
    if(tmp>ans)ans=tmp;
  }

  if(C.r>=ans)return 2;

  int res1=inside(C.p,ps,sz);

  double res2=100000000;
  ps[3]=ps[0];
  for(int i=0;i<sz;i++)
    res2=min(res2,distance_ls_p(ps[i],ps[i+1],C.p));

  if(res1 && C.r<=res2)return 1;
  else if(!res1 && C.r<res2)return 4;
  else return 3;
}

int main(void){
  point p[6];
  vector<segment> t;
  circle C;
  string ans="zabcd";

  while(true){
    for(int i=0;i<3;i++){
      cin >> p[i].x >> p[i].y;
      if(p[i].x==0 && p[i].y==0)return 0;
    }
    cin >> C.p.x >> C.p.y >> C.r;

    int res=crossCP(p,C,3);
    cout << ans[res] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int inside(point, point*, int)':
a.cc:93:10: error: 'INT_MAX' was not declared in this scope
   93 |   lt.b.x=INT_MAX;
      |          ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<vector>
  +++ |+#include <climits>
    5 | #include<string>