Language: C++

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

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

bool operator == ( const point &p ) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};

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


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_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 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 p, vector<point> ps, int n){
point a,b;
a=b=p;
b.x=DBL_MAX;
ps.push_back(ps[0]);
double ymx=-DBL_MAX,ymn=DBL_MAX;
for(int i=0;i ymx=max(ymx,ps[i].y);
ymn=min(ymn,ps[i].y);
}
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 1;
}

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 crossCP(vector<point> t, circle C){

double ans=0;
int tsz=t.size();

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

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

int res1=inside(C.p,t,tsz);
double res2=DBL_MAX;

t.push_back(t[0]);

for(int i=0;i<tsz;i++)
res2=min(res2,distance_ls_p(t[i],t[i+1],C.p));

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

int main(void){
point p;
vector t;
circle C;
string ans="zabcd";

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

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

Compiler output:
a.cc: In function 'int inside(point, std::vector<point>, int)':
a.cc:101:14: error: expected ';' before 'ymx'
  101 | for(int i=0;i ymx=max(ymx,ps[i].y);
      |              ^~~~
      |              ;
a.cc:101:35: error: expected ')' before ';' token
  101 | for(int i=0;i ymx=max(ymx,ps[i].y);
      |    ~                              ^
      |                                   )
a.cc:102:16: error: 'i' was not declared in this scope
  102 | ymn=min(ymn,ps[i].y);
      |                ^
a.cc:103:1: warning: no return statement in function returning non-void [-Wreturn-type]
  103 | }
      | ^
a.cc: At global scope:
a.cc:104:1: error: expected unqualified-id before 'if'
  104 | if(a.y<=ymn||a.y>=ymx)return 0;
      | ^~
a.cc:106:1: error: expected unqualified-id before 'for'
  106 | for(int i=0;i<n;i++){
      | ^~~
a.cc:106:13: error: 'i' does not name a type
  106 | for(int i=0;i<n;i++){
      |             ^
a.cc:106:17: error: 'i' does not name a type
  106 | for(int i=0;i<n;i++){
      |                 ^
a.cc:111:1: error: expected unqualified-id before 'for'
  111 | for(int i=0;i<n;i++)
      | ^~~
a.cc:111:13: error: 'i' does not name a type
  111 | for(int i=0;i<n;i++)
      |             ^
a.cc:111:17: error: 'i' does not name a type
  111 | for(int i=0;i<n;i++)
      |                 ^
a.cc:115:1: error: expected unqualified-id before 'for'
  115 | for(int i=0;i<n;i++)
      | ^~~
a.cc:115:13: error: 'i' does not name a type
  115 | for(int i=0;i<n;i++)
      |             ^
a.cc:115:17: error: 'i' does not name a type
  115 | for(int i=0;i<n;i++)
      |                 ^
a.cc:118:1: error: expected unqualified-id before 'return'
  118 | return (cnt-cnt1)%2;
      | ^~~~~~
a.cc:119:1: error: expected declaration before '}' token
  119 | }
      | ^
a.cc: In function 'int crossCP(std::vector<point>, circle)':
a.cc:142:21: error: expected ';' before 'else'
  142 | else if(!res1 && C.r else return 3;
      |                     ^~~~~
      |                     ;
a.cc:143:1: error: expected primary-expression before '}' token
  143 | }
      | ^
a.cc:142:36: error: expected ')' before '}' token
  142 | else if(!res1 && C.r else return 3;
      |        ~                           ^
      |                                    )
  143 | }
      | ~                                   
a.cc:143:1: error: expected primary-expression before '}' token
  143 | }
      | ^
a.cc: In function 'int main()':
a.cc:147:8: error: class template argument deduction failed:
  147 | vector t;
      |        ^
a.cc:147:8: error: no matching function for call to 'vector()'
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>'
  707 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>'
  678 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
  659 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>'
  640 |       vector(vector&& __rv, const allocator_type& __m, false_type)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>'
  635 |       vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
  624 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>'
  620 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>'
  601 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>'
  569 |       vector(size_type __n, const value_type& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>'
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>'
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note:   template argument deduction/substitution failed:
a.cc:147:8: note:   couldn't deduce template parameter '_Tp'
  147 | vector t;
      |        ^
/usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>'
 2033 |     vector(_InputIterator, _InputIterator, _Allocator = _Allocator())
      |     ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:2033:5: note:   candidate expects 2 arguments, 0 provided
a.cc: In function 'int crossCP(std::vector<point>, circle)':
a.cc:143:1: warning: control reaches end of non-void function [-Wreturn-type]
  143 | }
      | ^