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

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

struct Point{
  double x, y;
};

void koch(int n, Point a, Point b){
  if(n == 0) return;
  Point s, t, u;
  double th = M_PI * 60.0 / 180.0;

  s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
  s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
  t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
  t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
  u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
  u.y = (t.x - s.x) * sin(th) - (t.y - s.y) * cos(th) + s.y;

  koch(n - 1, a, s);
  printf("%.8f %.8f\n", s.x, s.y);
  koch(n - 1, s, u);
  printf("%.8f %.8f\n", u.x, u.y);
  koch(n - 1, u, t);
  printf("%.8f %.8f\n", t.x, t.y);
  koch(n - 1, t, b);
}

int main(){
  Point a, b;
  int n;

  scanf("%d", &n);

  a.x = 0;
  a.y = 0;
  b.x = 100;
  B.y = 0:

  printf("%.8f %.8f\n", a.x, a.y);
  koch(n, a, b);
  printf("%.8f %.8f\n", b.x, b.y);

  return 0;
}

Compiler output:
main.c:8:18: error: unknown type name 'Point'; did you mean 'int'?
    8 | void koch(int n, Point a, Point b){
      |                  ^~~~~
      |                  int
main.c:8:27: error: unknown type name 'Point'; did you mean 'int'?
    8 | void koch(int n, Point a, Point b){
      |                           ^~~~~
      |                           int
main.c: In function 'main':
main.c:30:3: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   30 |   Point a, b;
      |   ^~~~~
      |   struct 
main.c:35:4: error: request for member 'x' in something not a structure or union
   35 |   a.x = 0;
      |    ^
main.c:36:4: error: request for member 'y' in something not a structure or union
   36 |   a.y = 0;
      |    ^
main.c:37:4: error: request for member 'x' in something not a structure or union
   37 |   b.x = 100;
      |    ^
main.c:38:3: error: 'B' undeclared (first use in this function)
   38 |   B.y = 0:
      |   ^
main.c:38:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:38:10: error: expected ';' before ':' token
   38 |   B.y = 0:
      |          ^
      |          ;
main.c:41:3: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   41 |   koch(n, a, b);
      |   ^~~~
main.c:42:26: error: request for member 'x' in something not a structure or union
   42 |   printf("%.8f %.8f\n", b.x, b.y);
      |                          ^
main.c:42:31: error: request for member 'y' in something not a structure or union
   42 |   printf("%.8f %.8f\n", b.x, b.y);
      |                               ^
Language: C

#include<stdio.h>
#include<math.h>
 
struct Point{
  double x, y;
};
 
void koch(int n, Point a, Point b){
  if(n == 0) return;
 
  Point s, t, u;
  double th = M_PI * 60.0 / 180.0;
 
  s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
  s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
  t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
  t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
  u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
  u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;
 
  koch(n - 1, a, s);
  printf("%.8f %.8f\n",s.x,s.y);
  koch(n - 1, s, u);
  printf("%.8f %.8f\n",u.x,u.y);
  koch(n - 1, u, t);
  printf("%.8f %.8f\n",t.x,t.y);
  koch(n - 1, t, b);
}
 
int main(){
  Point a, b;
  int n;
 
  scanf("%d",&n);
 
  a.x = 0;
  a.y = 0;
  b.x = 100;
  b.y = 0;
 
  printf("%.8f %.8f\n",a.x,a.y);
  koch(n, a, b);
  printf("%.8f %.8f\n",b.x,b.y);
 
  return 0;
}

Compiler output:
main.c:8:18: error: unknown type name 'Point'; did you mean 'int'?
    8 | void koch(int n, Point a, Point b){
      |                  ^~~~~
      |                  int
main.c:8:27: error: unknown type name 'Point'; did you mean 'int'?
    8 | void koch(int n, Point a, Point b){
      |                           ^~~~~
      |                           int
main.c: In function 'main':
main.c:31:3: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   31 |   Point a, b;
      |   ^~~~~
      |   struct 
main.c:36:4: error: request for member 'x' in something not a structure or union
   36 |   a.x = 0;
      |    ^
main.c:37:4: error: request for member 'y' in something not a structure or union
   37 |   a.y = 0;
      |    ^
main.c:38:4: error: request for member 'x' in something not a structure or union
   38 |   b.x = 100;
      |    ^
main.c:39:4: error: request for member 'y' in something not a structure or union
   39 |   b.y = 0;
      |    ^
main.c:41:25: error: request for member 'x' in something not a structure or union
   41 |   printf("%.8f %.8f\n",a.x,a.y);
      |                         ^
main.c:41:29: error: request for member 'y' in something not a structure or union
   41 |   printf("%.8f %.8f\n",a.x,a.y);
      |                             ^
main.c:42:3: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   42 |   koch(n, a, b);
      |   ^~~~
main.c:43:25: error: request for member 'x' in something not a structure or union
   43 |   printf("%.8f %.8f\n",b.x,b.y);
      |                         ^
main.c:43:29: error: request for member 'y' in something not a structure or union
   43 |   printf("%.8f %.8f\n",b.x,b.y);
      |                             ^
Language: C

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

struct Point {
    double x, y;
};

void koch(int n, Point a, Point b) {
    if( n == 0 ) return;
    Point s, t, u;
    double th = M_PI * 60.0 / 180.0; // ?????????????????¢??????????????????
    
    s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y = (t.x - s.x) * sin(th) - (t.y - s.y) * cos(th) + s.y;

    koch(n-1, a, s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n-1, s, u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n-1, u, t);
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n-1, t, b);
}

int main() {
    Point a, b;
    int n;

    scanf("%d", &n);

    a.x = 0;
    a.y = 0;
    b.x = 100;
    b.y = 0;

    printf("%.8f %.8f\n", a.x, a.y);
    koch(n, a, b);
    printf("%.8f %.8f\n", b.x, b.y);

    return 0;

}

Compiler output:
main.c:8:18: error: unknown type name 'Point'; did you mean 'int'?
    8 | void koch(int n, Point a, Point b) {
      |                  ^~~~~
      |                  int
main.c:8:27: error: unknown type name 'Point'; did you mean 'int'?
    8 | void koch(int n, Point a, Point b) {
      |                           ^~~~~
      |                           int
main.c: In function 'main':
main.c:30:5: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   30 |     Point a, b;
      |     ^~~~~
      |     struct 
main.c:35:6: error: request for member 'x' in something not a structure or union
   35 |     a.x = 0;
      |      ^
main.c:36:6: error: request for member 'y' in something not a structure or union
   36 |     a.y = 0;
      |      ^
main.c:37:6: error: request for member 'x' in something not a structure or union
   37 |     b.x = 100;
      |      ^
main.c:38:6: error: request for member 'y' in something not a structure or union
   38 |     b.y = 0;
      |      ^
main.c:40:28: error: request for member 'x' in something not a structure or union
   40 |     printf("%.8f %.8f\n", a.x, a.y);
      |                            ^
main.c:40:33: error: request for member 'y' in something not a structure or union
   40 |     printf("%.8f %.8f\n", a.x, a.y);
      |                                 ^
main.c:41:5: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   41 |     koch(n, a, b);
      |     ^~~~
main.c:42:28: error: request for member 'x' in something not a structure or union
   42 |     printf("%.8f %.8f\n", b.x, b.y);
      |                            ^
main.c:42:33: error: request for member 'y' in something not a structure or union
   42 |     printf("%.8f %.8f\n", b.x, b.y);
      |                                 ^
Language: C

#include <stdio.h>
#include <math.h>
  
typedef struct{
    double x,y;
} Point;
  
 
int koch(int n, Point p1, Point p2){
 
    Point s,t,u;
    double degree = M_PI / 3;
 
    if(n == 0)
    {
      printf("%.8f %.8f\n", p2.x, p2.y);
      return;
    }
 
    s.x = (2 * p1.x + 1 * p2.x) / 3.0;
    s.y = (2 * p1.y + 1 * p2.y) / 3.0;
    t.x = (1 * p1.x + 2 * p2.x) / 3.0;
    t.y = (1 * p1.y + 2 * p2.y) / 3.0;
    u.x = (t.x - s.x) * cos(degree) - (t.y - s.y) * sin(degree) + s.x;
    u.y = (t.x - s.x) * sin(degree) + (t.y - s.y) * cos(degree) + s.y;
 
    koch(n-1,p1,s);  
    koch(n-1,s,u);
    koch(n-1,u,t);    
    koch(n-1,t,p2);
}
  
  
int main(){
    int n;
    Point p1,p2;
      
    p1.x = 0;
    p1.y = 0;
    p2.x = 100;
    p2.y = 0;
      
    scanf("%d",&n);
 
    printf("%.8f %.8f\n",p1.x,p1.y);
    koch(n,p1,p2);
      
    return 0;

Compiler output:
main.c: In function 'koch':
main.c:17:7: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   17 |       return;
      |       ^~~~~~
main.c:9:5: note: declared here
    9 | int koch(int n, Point p1, Point p2){
      |     ^~~~
main.c: In function 'main':
main.c:48:5: error: expected declaration or statement at end of input
   48 |     return 0;
      |     ^~~~~~
Language: C

#include <stdio.h>
#include <math.h>
 
typedef struct{
  double x;
  double y;
}P;
 
void k( int num , P a , Point b ){
  if( num == 0 ){
	return ; 
	}
 
  P c,d,e;
 
 
  c.x = ( 2.0 * a.x + 1.0 * b.x ) / 3.0;
  c.y = ( 2.0 * a.y + 1.0 * b.y ) / 3.0;
  d.x = ( 1.0 * a.x + 2.0 * b.x ) / 3.0;
  d.y = ( 1.0 * a.y + 2.0 * b.y ) / 3.0;
  e.x = ( d.x - c.x ) * cos( M_PI/3 ) - (d.y - c.y ) * sin( M_PI/3 ) + c.x;
  e.y = ( d.x - c.x ) * sin( M_PI/3 ) + (d.y - c.y ) * cos( M_PI/3 ) + c.y;
 
  k( num - 1 , a , c );
  printf("%.8f %.8f\n" , c.x , c.y );

  k( num - 1 , c , e );
  printf("%.8f %.8f\n" , e.x , e.y );

  k( num - 1 , e , d );
  printf("%.8f %.8f\n" , d.x , d.y );

  k( num - 1 , d , b );
}

int main ( void ){
 
  int n;
 
  scanf("%d" , &n );
 
  P a = {0.0, 0.0};
  P b = {100.0, 0.0};
 
  printf("%.8f %.8f\n" , a.x , a.y );
  koch( n , a , b );
  printf("%.8f %.8f\n" , b.x , b.y );
 
  return 0;
}

Compiler output:
main.c:9:25: error: unknown type name 'Point'; did you mean 'int'?
    9 | void k( int num , P a , Point b ){
      |                         ^~~~~
      |                         int
main.c: In function 'main':
main.c:46:3: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   46 |   koch( n , a , b );
      |   ^~~~
Language: C

#include <stdio.h>
#include <math.h>
 
typedef struct{
  double x;
  double y;
}P;
 
void k( int num , P a , P b ){
  if( num == 0 ){
	return ; 
	}
 
  P c,d,e;
 
 
  c.x = ( 2.0 * a.x + 1.0 * b.x ) / 3.0;
  c.y = ( 2.0 * a.y + 1.0 * b.y ) / 3.0;
  d.x = ( 1.0 * a.x + 2.0 * b.x ) / 3.0;
  d.y = ( 1.0 * a.y + 2.0 * b.y ) / 3.0;
  e.x = ( d.x - c.x ) * cos( M_PI/3 ) - (d.y - c.y ) * sin( M_PI/3 ) + c.x;
  e.y = ( d.x - c.x ) * sin( M_PI/3 ) + (d.y - c.y ) * cos( M_PI/3 ) + c.y;
 
  k( num - 1 , a , c );
  printf("%.8f %.8f\n" , c.x , c.y );

  k( num - 1 , c , e );
  printf("%.8f %.8f\n" , e.x , e.y );

  k( num - 1 , e , d );
  printf("%.8f %.8f\n" , d.x , d.y );

  k( num - 1 , d , b );
}

int main ( void ){
 
  int n;
 
  scanf("%d" , &n );
 
  P a = {0.0, 0.0};
  P b = {100.0, 0.0};
 
  printf("%.8f %.8f\n" , a.x , a.y );
  koch( n , a , b );
  printf("%.8f %.8f\n" , b.x , b.y );
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:3: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   46 |   koch( n , a , b );
      |   ^~~~
Language: C

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

struct Point { double x, y; };

void koch(int n, Point a, Point b) {
    if( n == 0 ) return;
    Point s, t, u;
    double th = M_PI * 60.0 / 180.0; // ?????????????????¢??????????????????
    
    s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y = (t.x - s.x) * sin(th) - (t.y - s.y) * cos(th) + s.y;

    koch(n-1, a, s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n-1, s, u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n-1, u, t);
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n-1, t, b);
}

int main() {
    Point a, b;
    int n;

    scanf("%d", &n);

    a.x = 0;
    a.y = 0;
    b.x = 100;
    b.y = 0;

    printf("%.8f %.8f\n", a.x, a.y);
    koch(n, a, b);
    printf("%.8f %.8f\n", b.x, b.y);

    return 0;

}

Compiler output:
main.c:6:18: error: unknown type name 'Point'; did you mean 'int'?
    6 | void koch(int n, Point a, Point b) {
      |                  ^~~~~
      |                  int
main.c:6:27: error: unknown type name 'Point'; did you mean 'int'?
    6 | void koch(int n, Point a, Point b) {
      |                           ^~~~~
      |                           int
main.c: In function 'main':
main.c:28:5: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   28 |     Point a, b;
      |     ^~~~~
      |     struct 
main.c:33:6: error: request for member 'x' in something not a structure or union
   33 |     a.x = 0;
      |      ^
main.c:34:6: error: request for member 'y' in something not a structure or union
   34 |     a.y = 0;
      |      ^
main.c:35:6: error: request for member 'x' in something not a structure or union
   35 |     b.x = 100;
      |      ^
main.c:36:6: error: request for member 'y' in something not a structure or union
   36 |     b.y = 0;
      |      ^
main.c:38:28: error: request for member 'x' in something not a structure or union
   38 |     printf("%.8f %.8f\n", a.x, a.y);
      |                            ^
main.c:38:33: error: request for member 'y' in something not a structure or union
   38 |     printf("%.8f %.8f\n", a.x, a.y);
      |                                 ^
main.c:39:5: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   39 |     koch(n, a, b);
      |     ^~~~
main.c:40:28: error: request for member 'x' in something not a structure or union
   40 |     printf("%.8f %.8f\n", b.x, b.y);
      |                            ^
main.c:40:33: error: request for member 'y' in something not a structure or union
   40 |     printf("%.8f %.8f\n", b.x, b.y);
      |                                 ^
Language: C

#include <stdio.h>
#include <math.h>
struct point{
	double x,y;
};

void koch(int n, struct point a,struct point b){
	if(n==0) return;
	struct point s,t,u;

	double tp = 3.14 * 60.0/180.0;

	s.x = (2.0 * a.x + 1.0*b.x)/3.0;
  	s.y = (2.0 * a.y + 1.0*b.y)/3.0;
  	t.x = (1.0 * a.x + 2.0*b.x)/3.0;
  	t.y = (1.0 * a.y + 2.0*b.y)/3.0;
	u.x = (t.x - s.x) * cos(tp) - (t.y - s.y) * sin(tp)+s.x; 
	u.y = (t.x - s.x) * sin(tp) - (t.y - s.y) * cos(tp)+s.y; 
  	
  	koch(n-1,a,s);
  	printf("%.8f %.8f\n",s.x,s.y);
  	koch(n-1,s,u);
  	printf("%.8f %.8f\n",u.x,u.y);
  	koch(n-1,u,t);
  	printf("%.8f %.8f\n",t.x,t.y);
  	koch(n-1,t,b);
}

void print(){
	printf("%.8f %.8f\n",a.x,a.y);
	koch(n,a,b);
	printf("%.8f %.8f\n",b.x,b.y);
}
int main(){
	struct point a,b;
	int n;

	a.x = 0;
	a.y = 0;
	b.x = 100;
	b.y = 0;
	return 0;
}

Compiler output:
main.c: In function 'print':
main.c:30:30: error: 'a' undeclared (first use in this function)
   30 |         printf("%.8f %.8f\n",a.x,a.y);
      |                              ^
main.c:30:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:14: error: 'n' undeclared (first use in this function); did you mean 'yn'?
   31 |         koch(n,a,b);
      |              ^
      |              yn
main.c:31:18: error: 'b' undeclared (first use in this function)
   31 |         koch(n,a,b);
      |                  ^
Language: C

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

struct Point{
  double x;
  double y;
};

void koch(int n,Point a,Point b){
  Point s,t,u;
  double th=M_PI*60.0/180.0;

  if(n == 0) return;
  s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
  s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
  t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
  t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
  u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
  u.x = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

  koch(n-1,a,s);
    printf("%.8f %.8f\n",s.x,s.y);
  koch(n-1,s,u);
    printf("%.8f %.8f\n",u.x,u.y);
  koch(n-1,u,t);
    printf("%.8f %.8f\n",t.x,t.y);
  koch(n-1,t,b);
}

int main(){
  Point a,b;
  int n;

  scanf("%d",&n);

  a.x = 0;
  a.y = 0;
  b.x = 100;
  b.y = 0;

  printf("%.8f %.8f\n",a.x,a.y);
  koch(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);

  return 0;
}

Compiler output:
main.c:9:17: error: unknown type name 'Point'; did you mean 'int'?
    9 | void koch(int n,Point a,Point b){
      |                 ^~~~~
      |                 int
main.c:9:25: error: unknown type name 'Point'; did you mean 'int'?
    9 | void koch(int n,Point a,Point b){
      |                         ^~~~~
      |                         int
main.c: In function 'main':
main.c:31:3: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   31 |   Point a,b;
      |   ^~~~~
      |   struct 
main.c:36:4: error: request for member 'x' in something not a structure or union
   36 |   a.x = 0;
      |    ^
main.c:37:4: error: request for member 'y' in something not a structure or union
   37 |   a.y = 0;
      |    ^
main.c:38:4: error: request for member 'x' in something not a structure or union
   38 |   b.x = 100;
      |    ^
main.c:39:4: error: request for member 'y' in something not a structure or union
   39 |   b.y = 0;
      |    ^
main.c:41:25: error: request for member 'x' in something not a structure or union
   41 |   printf("%.8f %.8f\n",a.x,a.y);
      |                         ^
main.c:41:29: error: request for member 'y' in something not a structure or union
   41 |   printf("%.8f %.8f\n",a.x,a.y);
      |                             ^
main.c:42:3: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   42 |   koch(n,a,b);
      |   ^~~~
main.c:43:25: error: request for member 'x' in something not a structure or union
   43 |   printf("%.8f %.8f\n",b.x,b.y);
      |                         ^
main.c:43:29: error: request for member 'y' in something not a structure or union
   43 |   printf("%.8f %.8f\n",b.x,b.y);
      |                             ^
Language: C

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

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

void koch(int d, point p1, point p2){
  if(d == 0)
    return;
  point s, t, u;
  s.x = (p1.x * 2 + p2.x)/3;
  s.y = (p1.y * 2 + p2.y)/3;
  t.x = (p1.x + p2.x * 2)/3;
  t.y = (p1.y + p2.y * 2)/3;
  u.x = (p1.x + p2.y)/2 + (p1.y - p2.y)/(2 * sqrt(3));
  u.y = (-p1.x + p2.x)/(2 * sqrt(3)) + (p1.y + p2.y)/2;
  koch(d-1, p1, s);
  printf("%f %f\n", s.x, s.y);
  koch(d-1, s, u);
  printf("%f %f\n", u.x, u.y);
  koch(d-1, u, t);
  printf("%f %f\n", t.x, t.y);
  koch(d-1, t, p2);
}

int main(void){
  point p1, p2;
  p1.x = 0;
  p1.y = 0;
  p2.x = 100;
  p2.y = 0;
  printf("%f %f\n", p1.x, p1.y);
  koch(p1, p2);
  printf("%f %f\n", p2.x, p2.y);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:8: error: incompatible type for argument 1 of 'koch'
   35 |   koch(p1, p2);
      |        ^~
      |        |
      |        point
main.c:9:15: note: expected 'int' but argument is of type 'point'
    9 | void koch(int d, point p1, point p2){
      |           ~~~~^
main.c:35:3: error: too few arguments to function 'koch'
   35 |   koch(p1, p2);
      |   ^~~~
main.c:9:6: note: declared here
    9 | void koch(int d, point p1, point p2){
      |      ^~~~
Language: C

/*
 * Problem Description: Recursion / Divide and Conquer - Koch Curve
 * Category:
 * Author: Khan
 * Date: 15th October, 2017
 */

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

struct Point
{
    double x, y;
};

void koch(int n, Point a, Point b)
{
    if(n == 0)
        return;
    Point s, t, u;
    double th = M_PI * 60.0 / 180.0;

    s.x =(2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y =(2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x =(1.0 * a.x + 2.0 * b.x) / 3.0;;
    t.y =(1.0 * a.y + 2.0 * b.y) / 3.0;;
    u.x =(t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y =(t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

    koch(n - 1, a, s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n - 1, s, u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n - 1, u, t);
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n - 1, t, b);
}

int main(int argc, char const *argv[])
{
    //freopen("sample.txt", "r", stdin);
    Point a, b;
    int n;

    scanf("%d", &n);
    a.x = 0;
    a.y = 0;
    b.x = 100;
    b.y = 0;

    printf("%.8f %.8f\n", a.x, a.y);
    koch(n, a, b);
    printf("%.8f %.8f\n", b.x, b.y);

    return 0;
}

Compiler output:
main.c:16:18: error: unknown type name 'Point'; did you mean 'int'?
   16 | void koch(int n, Point a, Point b)
      |                  ^~~~~
      |                  int
main.c:16:27: error: unknown type name 'Point'; did you mean 'int'?
   16 | void koch(int n, Point a, Point b)
      |                           ^~~~~
      |                           int
main.c: In function 'main':
main.c:42:5: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   42 |     Point a, b;
      |     ^~~~~
      |     struct 
main.c:46:6: error: request for member 'x' in something not a structure or union
   46 |     a.x = 0;
      |      ^
main.c:47:6: error: request for member 'y' in something not a structure or union
   47 |     a.y = 0;
      |      ^
main.c:48:6: error: request for member 'x' in something not a structure or union
   48 |     b.x = 100;
      |      ^
main.c:49:6: error: request for member 'y' in something not a structure or union
   49 |     b.y = 0;
      |      ^
main.c:51:28: error: request for member 'x' in something not a structure or union
   51 |     printf("%.8f %.8f\n", a.x, a.y);
      |                            ^
main.c:51:33: error: request for member 'y' in something not a structure or union
   51 |     printf("%.8f %.8f\n", a.x, a.y);
      |                                 ^
main.c:52:5: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   52 |     koch(n, a, b);
      |     ^~~~
main.c:53:28: error: request for member 'x' in something not a structure or union
   53 |     printf("%.8f %.8f\n", b.x, b.y);
      |                            ^
main.c:53:33: error: request for member 'y' in something not a structure or union
   53 |     printf("%.8f %.8f\n", b.x, b.y);
      |                                 ^
Language: C

#include<stdio.h>
#include<math.h>
????
int koch(double x1,double y1,double x2,double y2,int n){
??
????if(n==0){
????????printf("%f %f\n",x2,y2);
????????return 0;
????}
??
????double Ax,Ay,Bx,By,Cx,Cy;
????Ax=(x2-x1)/3+x1;
????Ay=(y2-y1)/3+y1;
????Bx=(x2-x1)*2/3+x1;
????By=(y2-y1)*2/3+y1;
????Cx=(cos(M_PI/3)*(Bx-Ax)-sin(M_PI/3)*(By-Ay))+Ax;
????Cy=(sin(M_PI/3)*(Bx-Ax)+cos(M_PI/3)*(By-Ay))+Ay;
????koch(x1, y1, Ax, Ay, n-1);
????koch(Ax, Ay, Cx, Cy, n-1);
????koch(Cx, Cy, Bx, By, n-1);
????koch(Bx, By, x2, y2, n-1);
????????
}
??
??
int main(){
????int n;
????double x1=0,y1=0,x2=100,y2=0;
????scanf("%d",&n);
????printf("0.00000000 0.00000000\n");
????koch(x1,y1,x2,y2,n);
????return 0;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ????
      | ^
main.c:24:1: error: expected identifier or '(' before '?' token
   24 | ??
      | ^
Language: C


#include<studio.h>
#include<math.h>
struct point {
    double x, y;
};
void koch(int n, struct point a, struct point b) {
    if ( n == 0) return;
    struct point s, t, u;
    double rad = 3.1415926535897932384626 / 3;
    s.x = ( 2 * a.x + b.x ) / 3;
    s.y = ( 2 * a.y + b.y ) / 3;
    t.x = ( a.x + 2 * b.x ) / 3;
    t.y = ( a.y + 2 * b.y ) / 3;
    u.x = ( t.x - s.x ) * cos(rad) - ( t.y - s.y ) * sin(rad) + s.x;
    u.y = ( t.x - s.x ) * sin(rad) + ( t.y - s.y ) * cos(rad) + s.y;
    koch(n - 1, a, s);
    if ( s.x < 0 ) s.x *= -1;
    if ( s.y < 0 ) s.y *= -1;
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n - 1, s, u);
    if ( u.x < 0 ) u.x *= -1;
    if ( u.y < 0 ) u.y *= -1;
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n - 1, u, t);
    if ( t.x < 0 ) t.x *= -1;
    if ( t.y < 0 ) t.y *= -1;
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n - 1, t, b);
}
 
int main(void) {
    struct point p, q;
    int n;
    scanf("%d", &n);
    p.x = 0;
    p.y = 0;
    q.x = 100;
    q.y = 0;
    printf("%.8f %.8f\n", p.x, p.y);
    koch(n, p, q);
    printf("%.8f %.8f\n", q.x, q.y);
 
    return

Compiler output:
main.c:2:9: fatal error: studio.h: No such file or directory
    2 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C


#include<studio.h>
#include<math.h>
struct point {
    double x, y;
}
void koch(int n, struct point a, struct point b) {
    if ( n == 0) return;
    struct point s, t, u;
    double rad = 3.1415926535897932384626 / 3;
    s.x = ( 2 * a.x + b.x ) / 3;
    s.y = ( 2 * a.y + b.y ) / 3;
    t.x = ( a.x + 2 * b.x ) / 3;
    t.y = ( a.y + 2 * b.y ) / 3;
    u.x = ( t.x - s.x ) * cos(rad) - ( t.y - s.y ) * sin(rad) + s.x;
    u.y = ( t.x - s.x ) * sin(rad) + ( t.y - s.y ) * cos(rad) + s.y;
    koch(n - 1, a, s);
    if ( s.x < 0 ) s.x *= -1;
    if ( s.y < 0 ) s.y *= -1;
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n - 1, s, u);
    if ( u.x < 0 ) u.x *= -1;
    if ( u.y < 0 ) u.y *= -1;
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n - 1, u, t);
    if ( t.x < 0 ) t.x *= -1;
    if ( t.y < 0 ) t.y *= -1;
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n - 1, t, b);
}
 
int main(void) {
    struct point p, q;
    int n;
    scanf("%d", &n);
    p.x = 0;
    p.y = 0;
    q.x = 100;
    q.y = 0;
    printf("%.8f %.8f\n", p.x, p.y);
    koch(n, p, q);
    printf("%.8f %.8f\n", q.x, q.y);
 
    return

Compiler output:
main.c:2:9: fatal error: studio.h: No such file or directory
    2 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

struct Point { double x, y; };

void koch(int n, Point a, Point b)
{
    if (n == 0) return;

    Point s, t, u;
    double th = M_PI * 60.0 / 180.0;

    s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
    u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

    koch(n - 1, a, s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n - 1, s, u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n - 1, u, t);
    printf("%.8d %.8f\n", t.x, t.y);
    koch(n - 1, t, b);
}


int main(int argc, char const *argv[])
{
    Point a, b;
    int n;

    scanf("%d", &n);

    a.x = 0;
    a.y = 0;
    b.x = 100;
    b.y = 0;

    printf("%.8f %.8f\n", a.x, a.y);
    koch(n, a, b);
    printf("%.8f %.8f\n", b.x, b.y);

    return 0;
}



Compiler output:
main.c:6:18: error: unknown type name 'Point'; did you mean 'int'?
    6 | void koch(int n, Point a, Point b)
      |                  ^~~~~
      |                  int
main.c:6:27: error: unknown type name 'Point'; did you mean 'int'?
    6 | void koch(int n, Point a, Point b)
      |                           ^~~~~
      |                           int
main.c: In function 'main':
main.c:32:5: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   32 |     Point a, b;
      |     ^~~~~
      |     struct 
main.c:37:6: error: request for member 'x' in something not a structure or union
   37 |     a.x = 0;
      |      ^
main.c:38:6: error: request for member 'y' in something not a structure or union
   38 |     a.y = 0;
      |      ^
main.c:39:6: error: request for member 'x' in something not a structure or union
   39 |     b.x = 100;
      |      ^
main.c:40:6: error: request for member 'y' in something not a structure or union
   40 |     b.y = 0;
      |      ^
main.c:42:28: error: request for member 'x' in something not a structure or union
   42 |     printf("%.8f %.8f\n", a.x, a.y);
      |                            ^
main.c:42:33: error: request for member 'y' in something not a structure or union
   42 |     printf("%.8f %.8f\n", a.x, a.y);
      |                                 ^
main.c:43:5: error: implicit declaration of function 'koch' [-Wimplicit-function-declaration]
   43 |     koch(n, a, b);
      |     ^~~~
main.c:44:28: error: request for member 'x' in something not a structure or union
   44 |     printf("%.8f %.8f\n", b.x, b.y);
      |                            ^
main.c:44:33: error: request for member 'y' in something not a structure or union
   44 |     printf("%.8f %.8f\n", b.x, b.y);
      |                                 ^
Language: C

#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node{
  int key;
  Node *next, *prev;
};

Node *nil;

Node* listSearch(int key){
  Node *cur = nil->next;
  while(cur != nil && cur ->key != key){
    cur = cur->next;
  }
  return cur;
}

void init(){
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  Node *cur = nil->next;
  int isf = 0;
  while(1){
    if(cur == nil) break;
    if(isf++ > 0) printf(" ");
    printf("%d",cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t){
  if(t == nil) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(){
  deleteNode(nil->next);
}

void deleteLast(){
  deleteNode(nil->prev);
}

void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d",&n);
  init();
  for(i = 0 ; i < n ; i++){
    scanf("%s%d",com,&key);
    if(com[0] == 'i'){insert(key); np++; size++;}
    else if(com[0] == 'd'){
      if(strlen(com) > 6){
	if(com[6] == 'F') deleteFirst();
	else if(com[6] == 'L') deleteLast();
      }else{
	deleteKey(key); nd++;
      }
      size--;
    }
  }

  printList();

  return 0;
}


Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <math.h>
 
#define N 4100
 
typedef struct{
  double x, y;
}P;
 
P dat[N], tmp[N];
int siz;
 
void koch(P a,P b,int n,int p);

main(){
  int i, n;
  scanf("%d",&n);
  dat[siz++] = {0.0, 0.0};
  koch(dat[0], {100.0, 0.0}, n, 0);
  dat[siz++] = {100.0, 0.0};
  for(i=0;i<siz;i++) printf("%.8f %.8f\n", dat[i].x, dat[i].y);
  return 0;
}
void koch(P a, P b, int n, int p){
  P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
  P s = o.x + a.x, o.y + a.y;
  P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
  P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
  if(p == n) return;
  koch(a,s,n,p+1);
  data[siz++] = s;
  koch(s,u,n,p+1);
  data[siz++] = u;
  koch(u,t,n,p+1);
  data[siz++] = t;
  koch(t,b,n,p+1);
}
 

Compiler output:
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
   15 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:16: error: expected expression before '{' token
   18 |   dat[siz++] = {0.0, 0.0};
      |                ^
main.c:19:16: error: expected expression before '{' token
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |                ^
main.c:19:3: error: too few arguments to function 'koch'
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |   ^~~~
main.c:13:6: note: declared here
   13 | void koch(P a,P b,int n,int p);
      |      ^~~~
main.c:20:16: error: expected expression before '{' token
   20 |   dat[siz++] = {100.0, 0.0};
      |                ^
main.c: In function 'koch':
main.c:25:9: error: invalid initializer
   25 |   P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
      |         ^
main.c:25:28: error: expected ')' before '.' token
   25 |   P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
      |                            ^
      |                            )
main.c:26:9: error: invalid initializer
   26 |   P s = o.x + a.x, o.y + a.y;
      |         ^
main.c:26:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   26 |   P s = o.x + a.x, o.y + a.y;
      |                     ^
main.c:27:9: error: invalid initializer
   27 |   P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
      |         ^
main.c:27:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   27 |   P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
      |                                                  ^
main.c:28:9: error: invalid initializer
   28 |   P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
      |         ^
main.c:28:34: error: expected ')' before '.' token
   28 |   P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
      |                                  ^
      |                                  )
main.c:31:3: error: 'data' undeclared (first use in this function); did you mean 'dat'?
   31 |   data[siz++] = s;
      |   ^~~~
      |   dat
main.c:31:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
 
#define N 4100
 
typedef struct{
  double x, y;
}P;
 
P dat[N], tmp[N];
int siz;
 
void koch(P,P,int,int);

main(){
  int i, n;
  scanf("%d",&n);
  dat[siz++] = {0.0, 0.0};
  koch(dat[0], {100.0, 0.0}, n, 0);
  dat[siz++] = {100.0, 0.0};
  for(i=0;i<siz;i++) printf("%.8f %.8f\n", dat[i].x, dat[i].y);
  return 0;
}
void koch(P a, P b, int n, int p){
  P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
  P s = o.x + a.x, o.y + a.y;
  P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
  P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
  if(p == n) return;
  koch(a,s,n,p+1);
  data[siz++] = s;
  koch(s,u,n,p+1);
  data[siz++] = u;
  koch(u,t,n,p+1);
  data[siz++] = t;
  koch(t,b,n,p+1);
}
 

Compiler output:
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
   15 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:16: error: expected expression before '{' token
   18 |   dat[siz++] = {0.0, 0.0};
      |                ^
main.c:19:16: error: expected expression before '{' token
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |                ^
main.c:19:3: error: too few arguments to function 'koch'
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |   ^~~~
main.c:13:6: note: declared here
   13 | void koch(P,P,int,int);
      |      ^~~~
main.c:20:16: error: expected expression before '{' token
   20 |   dat[siz++] = {100.0, 0.0};
      |                ^
main.c: In function 'koch':
main.c:25:9: error: invalid initializer
   25 |   P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
      |         ^
main.c:25:28: error: expected ')' before '.' token
   25 |   P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
      |                            ^
      |                            )
main.c:26:9: error: invalid initializer
   26 |   P s = o.x + a.x, o.y + a.y;
      |         ^
main.c:26:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   26 |   P s = o.x + a.x, o.y + a.y;
      |                     ^
main.c:27:9: error: invalid initializer
   27 |   P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
      |         ^
main.c:27:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   27 |   P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
      |                                                  ^
main.c:28:9: error: invalid initializer
   28 |   P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
      |         ^
main.c:28:34: error: expected ')' before '.' token
   28 |   P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
      |                                  ^
      |                                  )
main.c:31:3: error: 'data' undeclared (first use in this function); did you mean 'dat'?
   31 |   data[siz++] = s;
      |   ^~~~
      |   dat
main.c:31:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
 
#define N 4100
 
typedef struct{
  double x, y;
}P;
 
P dat[N], tmp[N];
int siz;
 
void koch(P,P,int,int);

main(){
  int i, n;
  scanf("%d",&n);
  dat[siz++] = {0.0, 0.0};
  koch(dat[0], {100.0, 0.0}, n, 0);
  dat[siz++] = {100.0, 0.0};
  for(i=0;i<siz;i++) printf("%.8f %.8f\n", dat[i].x, dat[i].y);
  return 0;
}
void koch(P a, P b, int n, int p){
  P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
  P s = o.x + a.x, o.y + a.y;
  P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
  P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
  if(p == n) return;
  koch(a,s,n,p+1);
  dat[siz++] = s;
  koch(s,u,n,p+1);
  dat[siz++] = u;
  koch(u,t,n,p+1);
  dat[siz++] = t;
  koch(t,b,n,p+1);
}
 

Compiler output:
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
   15 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:16: error: expected expression before '{' token
   18 |   dat[siz++] = {0.0, 0.0};
      |                ^
main.c:19:16: error: expected expression before '{' token
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |                ^
main.c:19:3: error: too few arguments to function 'koch'
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |   ^~~~
main.c:13:6: note: declared here
   13 | void koch(P,P,int,int);
      |      ^~~~
main.c:20:16: error: expected expression before '{' token
   20 |   dat[siz++] = {100.0, 0.0};
      |                ^
main.c: In function 'koch':
main.c:25:9: error: invalid initializer
   25 |   P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
      |         ^
main.c:25:28: error: expected ')' before '.' token
   25 |   P o = (b.x - a.x)/3.0, (b.y - a.y)/3.0;
      |                            ^
      |                            )
main.c:26:9: error: invalid initializer
   26 |   P s = o.x + a.x, o.y + a.y;
      |         ^
main.c:26:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   26 |   P s = o.x + a.x, o.y + a.y;
      |                     ^
main.c:27:9: error: invalid initializer
   27 |   P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
      |         ^
main.c:27:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   27 |   P u = s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0;
      |                                                  ^
main.c:28:9: error: invalid initializer
   28 |   P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
      |         ^
main.c:28:34: error: expected ')' before '.' token
   28 |   P t = (b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y;
      |                                  ^
      |                                  )
Language: C

#include <stdio.h>
#include <math.h>
 
#define N 4100
 
typedef struct{
  double x, y;
}P;
 
P dat[N], tmp[N];
int siz;
 
void koch(P,P,int,int);

main(){
  int i, n;
  scanf("%d",&n);
  dat[siz++] = {0.0, 0.0};
  koch(dat[0], {100.0, 0.0}, n, 0);
  dat[siz++] = {100.0, 0.0};
  for(i=0;i<siz;i++) printf("%.8f %.8f\n", dat[i].x, dat[i].y);
  return 0;
}
void koch(P a, P b, int n, int p){
  P o = {(b.x - a.x)/3.0, (b.y - a.y)/3.0};
  P s = {o.x + a.x, o.y + a.y};
  P u = {s.x + o.x /2.0 - sqrt(3.0) * o.y / 2.0, s.y + sqrt(3.0) * o.x /2.0 + o.y /2.0};
  P t = {(b.x-a.x)*2.0/3.0+a.x, (b.y-a.y)*2.0/3.0+a.y};
  if(p == n) return;
  koch(a,s,n,p+1);
  dat[siz++] = s;
  koch(s,u,n,p+1);
  dat[siz++] = u;
  koch(u,t,n,p+1);
  dat[siz++] = t;
  koch(t,b,n,p+1);
}
 

Compiler output:
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
   15 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:16: error: expected expression before '{' token
   18 |   dat[siz++] = {0.0, 0.0};
      |                ^
main.c:19:16: error: expected expression before '{' token
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |                ^
main.c:19:3: error: too few arguments to function 'koch'
   19 |   koch(dat[0], {100.0, 0.0}, n, 0);
      |   ^~~~
main.c:13:6: note: declared here
   13 | void koch(P,P,int,int);
      |      ^~~~
main.c:20:16: error: expected expression before '{' token
   20 |   dat[siz++] = {100.0, 0.0};
      |                ^
Language: C

#include<stdio.h>
#include<math.h>
int n;
int koch(double x1,double y1,double x2,double y2){
  if(n==0){
    printf("%f %f\n",x2,y2);
    return 0;
  }
  double Sx,Sy,Tx,Ty,Ux,Uy;
  Sx=(x2-x1)/3+x1;
  Sy=(y2-y1)/3+y1;
  Tx=(x2-x1)*2/3+x1;
  Ty=(y2-y1)*2/3+y1;
  Ux=(cos(M_PI/3)*(Tx-Sx)-sin(M_PI/3)*(Ty-Sy))+Sx;
  Uy=(sin(M_PI/3)*(Tx-Sx)+cos(M_PI/3)*(Ty-Sy))+Sy;
  koch(x1, y1, Sx, Sy, n-1);
  koch(Sx, Sy, Ux, Uy, n-1);
  koch(Ux, Uy, Tx, Ty, n-1);
  koch(Tx, Ty, x2, y2, n-1);
  


}
int main(){
  double x1=0.0,y1=0.0;
  double x2=100.0,y2=0.0;
  scanf("%d",&n);
  printf("0.00000000 0.00000000\n");
  koch(x1,y1,x2,y2,n);
  return 0;
}

Compiler output:
main.c: In function 'koch':
main.c:16:3: error: too many arguments to function 'koch'
   16 |   koch(x1, y1, Sx, Sy, n-1);
      |   ^~~~
main.c:4:5: note: declared here
    4 | int koch(double x1,double y1,double x2,double y2){
      |     ^~~~
main.c:17:3: error: too many arguments to function 'koch'
   17 |   koch(Sx, Sy, Ux, Uy, n-1);
      |   ^~~~
main.c:4:5: note: declared here
    4 | int koch(double x1,double y1,double x2,double y2){
      |     ^~~~
main.c:18:3: error: too many arguments to function 'koch'
   18 |   koch(Ux, Uy, Tx, Ty, n-1);
      |   ^~~~
main.c:4:5: note: declared here
    4 | int koch(double x1,double y1,double x2,double y2){
      |     ^~~~
main.c:19:3: error: too many arguments to function 'koch'
   19 |   koch(Tx, Ty, x2, y2, n-1);
      |   ^~~~
main.c:4:5: note: declared here
    4 | int koch(double x1,double y1,double x2,double y2){
      |     ^~~~
main.c: In function 'main':
main.c:29:3: error: too many arguments to function 'koch'
   29 |   koch(x1,y1,x2,y2,n);
      |   ^~~~
main.c:4:5: note: declared here
    4 | int koch(double x1,double y1,double x2,double y2){
      |     ^~~~
Language: C

#include <stdio.h>
#include <math.h>int n,count=0;double rad = M_PI/3;void segment(double x1, double y1, double x5, double y5, int count){double x2, y2, x3, y3, x4, y4;x2 = (2*x1+x5)/3.0;y2 = (2*y1+y5)/3.0;x4 = (x1+2*x5)/3.0;y4 = (y1+2*y5)/3.0;x3 = x2+(x4-x2)*cos(rad) + (y4-y2)*sin(rad);y3 = y2+(x4-x2)*sin(rad) - (y4-y2)*cos(rad);count++;if(count != n){segment(x1, y1, x2, y2, count);segment(x2, y2, x3, y3, count);segment(x3, y3, x4, y4, count);segment(x4, y4, x5, y5, count);}else{printf("%f %f\n",x2,y2);printf("%f %f\n",x3,y3);printf("%f %f\n",x4,y4);printf("%f %f\n",x5,y5);}}int main(){double x1=0, x2=100;scanf("%d",&n);printf("%f %f\n",x1 ,x1);segment(x1, x1, x2, x1, count);return 0;}

Compiler output:
main.c:2:18: warning: extra tokens at end of #include directive
    2 | #include <math.h>int n,count=0;double rad = M_PI/3;void segment(double x1, double y1, double x5, double y5, int count){double x2, y2, x3, y3, x4, y4;x2 = (2*x1+x5)/3.0;y2 = (2*y1+y5)/3.0;x4 = (x1+2*x5)/3.0;y4 = (y1+2*y5)/3.0;x3 = x2+(x4-x2)*cos(rad) + (y4-y2)*sin(rad);y3 = y2+(x4-x2)*sin(rad) - (y4-y2)*cos(rad);count++;if(count != n){segment(x1, y1, x2, y2, count);segment(x2, y2, x3, y3, count);segment(x3, y3, x4, y4, count);segment(x4, y4, x5, y5, count);}else{printf("%f %f\n",x2,y2);printf("%f %f\n",x3,y3);printf("%f %f\n",x4,y4);printf("%f %f\n",x5,y5);}}int main(){double x1=0, x2=100;scanf("%d",&n);printf("%f %f\n",x1 ,x1);segment(x1, x1, x2, x1, count);return 0;}
      |                  ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>

#define SIN_60 0.86602540378443864

typedef struct {
	double x;
	double y;
} Point;

void devide(Point left, Point right, Point* m_left, Point* m_right) {
	Point len;
	len.x = (right.x - left.x) / 3.0;
	len.y = (right.y - left.y) / 3.0;
	m_left->x = left.x + len.x;
	m_left->y = left.y + len.y;
	m_right->x = right.x - len.x;
	m_right->y = right.y - len.y;
}

Point make_tri(Point left, Point right) {
	Point vec, vec2, tri;
	vec.x = right.x - left.x;
	vec.y = right.y - left.y;
	vec2.x = vec.x * 0.5 - vec.y * SIN_60;
	vec2.y = vec.x * SIN_60 + vec.y * 0.5;
	tri.x = left.x + vec2.x;
	tri.y = left.y + vec2.y;
	return tri;
}

void koch(Point left, Point right, int depth) {
	Point m_left, m_right, top;
	
	if (depth == 0) {
		printf("%f %f\n", right.x, right.y);
		return;
	}
	
	devide(left, right, &m_left, &m_right);
	top = make_tri(m_left, m_right);
	
	koch(left, m_left, depth - 1);
	koch(m_left, top, depth - 1);
	koch(top, m_right, depth - 1);
	koch(m_right, right, depth - 1);
}

int main(){
	Point left, right, n;
	left.x = 0.0;
	left.y = 0.0;
	right.x = 100.0;
	right.y = 0.0;
	
	scanf("%d", &n);
	
	printf("%f %f\n", left.x, left.y);
	koch(left, right, n);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:58:27: error: incompatible type for argument 3 of 'koch'
   58 |         koch(left, right, n);
      |                           ^
      |                           |
      |                           Point
main.c:31:40: note: expected 'int' but argument is of type 'Point'
   31 | void koch(Point left, Point right, int depth) {
      |                                    ~~~~^~~~~
Language: C

#include<stdio.h>
#include<math.h>
int n;

void compute(int depth,double x1,double y1,double x2,double y2){
  double si60 = sqrt(3.0)/2.0;
  double co60 = 0.5;
  
  double sx = (x1+x1+x2)/3.0;
  double sy = (y1+y1+y2)/3.0;
  double tx = (x1+x2+x2)/3.0;
  double ty = (y1+y2+y2)/3.0;
  
  double vx = tx-sx;
  double vy = ty-sy;
  
  double ux = sx + co60*vx - si60*vy;
  double uy = sy + si60*vx + co60*vy;
  
  if(depth>=n)return;
  
  compute(depth+1,x1,y1,sx,sy, 0);
  printf("%.8f %.8f\n",sx,sy);  
  compute(depth+1,sx,sy,ux,uy, 0);
  printf("%.8f %.8f\n",ux,uy);
  compute(depth+1,ux,uy,tx,ty, 0);
  printf("%.8f %.8f\n",tx,ty);    
  compute(depth+1,tx,ty,x2,y2, 0);

  
}

int main(){
  scanf("%d",&n);
  printf("%.8f %.8f\n",0.0,0.0);
  compute(0,0.0,0.0,100.0,0.0,0);
  printf("%.8f %.8f\n",100.0,0.0);
  return 0;
}

Compiler output:
main.c: In function 'compute':
main.c:22:3: error: too many arguments to function 'compute'
   22 |   compute(depth+1,x1,y1,sx,sy, 0);
      |   ^~~~~~~
main.c:5:6: note: declared here
    5 | void compute(int depth,double x1,double y1,double x2,double y2){
      |      ^~~~~~~
main.c:24:3: error: too many arguments to function 'compute'
   24 |   compute(depth+1,sx,sy,ux,uy, 0);
      |   ^~~~~~~
main.c:5:6: note: declared here
    5 | void compute(int depth,double x1,double y1,double x2,double y2){
      |      ^~~~~~~
main.c:26:3: error: too many arguments to function 'compute'
   26 |   compute(depth+1,ux,uy,tx,ty, 0);
      |   ^~~~~~~
main.c:5:6: note: declared here
    5 | void compute(int depth,double x1,double y1,double x2,double y2){
      |      ^~~~~~~
main.c:28:3: error: too many arguments to function 'compute'
   28 |   compute(depth+1,tx,ty,x2,y2, 0);
      |   ^~~~~~~
main.c:5:6: note: declared here
    5 | void compute(int depth,double x1,double y1,double x2,double y2){
      |      ^~~~~~~
main.c: In function 'main':
main.c:36:3: error: too many arguments to function 'compute'
   36 |   compute(0,0.0,0.0,100.0,0.0,0);
      |   ^~~~~~~
main.c:5:6: note: declared here
    5 | void compute(int depth,double x1,double y1,double x2,double y2){
      |      ^~~~~~~