Language: C++

#include<bits/stdc++.h>
using namespace std;
static float x1,y1,x2,y2;
void one(int h, int a){
    if(h<=3){
        if(h==0){
            x1=0;
            y1=a;
        }
        else if(h==1){
            x1=a*cos(60*3.14159/180);
            y1=a*sin(60*3.14159/180);
        }
        else if(h==2){
            x1=a*cos(30*3.14159/180);
            y1=a*sin(30*3.14159/180);
        }
        else if(h==3){
            x1=a;
            y1=0;
        }
    }
    else if(h>3 && h<=6){
        if(h==4){
            x1=a*cos(30*3.14159/180);
            y1=-a*sin(30*3.14159/180);
        }
        else if(h==5){
            x1=a*cos(60*3.14159/180);
            y1=-a*sin(60*3.14159/180);
        }
        else if(h==6){
            x1=0;
            y1=-a;
        }
    }
    else if(h>6 && h<=9){
        if(h==7){
            x1=-a*cos(60*3.14159/180);
            y1=-a*sin(60*3.14159/180);
        }
        else if(h==8){
            x1=-a*cos(30*3.14159/180);
            y1=-a*sin(30*3.14159/180);
        }
        else if(h==9){
            x1=-a;
            y1=0;
        }
    }
    else if(h>9 && h<12){
        if(h==10){
            x1=-a*cos(30*3.14159/180);
            y1=a*sin(30*3.14159/180);
        }
        else if(h==11){
            x1=-a*cos(60*3.14159/180);
            y1=a*sin(60*3.14159/180);
        }
    }
}
void two(int m, int b){
    if(m<=15){
        x2=b*cos((15-m)*4*3.14159/180);
        y2=b*sin((15-m)*4*3.14159/180);
    }
    else if(m>15 && m<=30){
        x2=b*cos((m-15)*4*3.14159/180);
        y2=-b*sin((m-15)*4*3.14159/180);
    }
    else if(m>30 && m<=45){
        x2=-b*cos((45-m)*4*3.14159/180);
        y2=-b*sin((45-m)*4*3.14159/180);
    }
    else if(m>45 && m<60){
        x2=-b*cos((m-45)*4*3.14159/180);
        y2=b*sin((m-45)*4*3.14159/180);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
    int a,b,h,m;
    cin>>a>>b>>h>>m;
    one(h,a);
    two(m,b);
    float r,u;
    r=x1-x2;
    u=y1-y2;
    float e=sqrt(pow(r,2)+pow(u,2));
    cout<<fixed<<setprecision(20)<<e;
    return 0;
}

Compiler output:
a.cc:3:17: error: 'float y1' redeclared as different kind of entity
    3 | static float x1,y1,x2,y2;
      |                 ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'void one(int, int)':
a.cc:8:15: error: assignment of function 'double y1(double)'
    8 |             y1=a;
      |             ~~^~
a.cc:12:15: error: assignment of function 'double y1(double)'
   12 |             y1=a*sin(60*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:16:15: error: assignment of function 'double y1(double)'
   16 |             y1=a*sin(30*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:20:15: error: assignment of function 'double y1(double)'
   20 |             y1=0;
      |             ~~^~
a.cc:26:15: error: assignment of function 'double y1(double)'
   26 |             y1=-a*sin(30*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:15: error: assignment of function 'double y1(double)'
   30 |             y1=-a*sin(60*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:34:15: error: assignment of function 'double y1(double)'
   34 |             y1=-a;
      |             ~~^~~
a.cc:40:15: error: assignment of function 'double y1(double)'
   40 |             y1=-a*sin(60*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:44:15: error: assignment of function 'double y1(double)'
   44 |             y1=-a*sin(30*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:48:15: error: assignment of function 'double y1(double)'
   48 |             y1=0;
      |             ~~^~
a.cc:54:15: error: assignment of function 'double y1(double)'
   54 |             y1=a*sin(30*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:58:15: error: assignment of function 'double y1(double)'
   58 |             y1=a*sin(60*3.14159/180);
      |             ~~^~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:90:9: error: invalid operands of types 'double(double) noexcept' and 'float' to binary 'operator-'
   90 |     u=y1-y2;
      |       ~~^~~
      |       |  |
      |       |  float
      |       double(double) noexcept