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

Compiler output:
main.c:4:1: error: expected specifier-qualifier-list before '?' token
    4 | ????????double x, y;
      | ^
main.c: In function 'koch':
main.c:7:1: error: expected expression before '?' token
    7 | ????????if ( n == 0) return;
      | ^
main.c:8:1: error: expected expression before '?' token
    8 | ????????struct point s, t, u;
      | ^
main.c:9:1: error: expected expression before '?' token
    9 | ????????double rad = 3.1415926535897932384626 / 3;
      | ^
main.c:10:1: error: expected expression before '?' token
   10 | ????????s.x = ( 2 * a.x + b.x ) / 3;
      | ^
main.c:10:9: error: 's' undeclared (first use in this function)
   10 | ????????s.x = ( 2 * a.x + b.x ) / 3;
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:36: error: expected ':' before ';' token
   10 | ????????s.x = ( 2 * a.x + b.x ) / 3;
      |                                    ^
      |                                    :
main.c:11:1: error: expected expression before '?' token
   11 | ????????s.y = ( 2 * a.y + b.y ) / 3;
      | ^
main.c:11:36: error: expected ':' before ';' token
   11 | ????????s.y = ( 2 * a.y + b.y ) / 3;
      |                                    ^
      |                                    :
main.c:12:1: error: expected expression before '?' token
   12 | ????????t.x = ( a.x + 2 * b.x ) / 3;
      | ^
main.c:12:9: error: 't' undeclared (first use in this function)
   12 | ????????t.x = ( a.x + 2 * b.x ) / 3;
      |         ^
main.c:12:18: error: 'struct point' has no member named 'x'
   12 | ????????t.x = ( a.x + 2 * b.x ) / 3;
      |                  ^
main.c:12:36: error: expected ':' before ';' token
   12 | ????????t.x = ( a.x + 2 * b.x ) / 3;
      |                                    ^
      |                                    :
main.c:13:1: error: expected expression before '?' token
   13 | ????????t.y = ( a.y + 2 * b.y ) / 3;
      | ^
main.c:13:18: error: 'struct point' has no member named 'y'
   13 | ????????t.y = ( a.y + 2 * b.y ) / 3;
      |                  ^
main.c:13:36: error: expected ':' before ';' token
   13 | ????????t.y = ( a.y + 2 * b.y ) / 3;
      |                                    ^
      |                                    :
main.c:14:1: error: expected expression before '?' token
   14 | ????????u.x = ( t.x - s.x ) * cos(rad) - ( t.y - s.y ) * sin(rad) + s.x;
      | ^
main.c:14:9: error: 'u' undeclared (first use in this function)
   14 | ????????u.x = ( t.x - s.x ) * cos(rad) - ( t.y - s.y ) * sin(rad) + s.x;
      |         ^
main.c:14:35: error: 'rad' undeclared (first use in this function)
   14 | ????????u.x = ( t.x - s.x ) * cos(rad) - ( t.y - s.y ) * sin(rad) + s.x;
      |                                   ^~~
main.c:14:72: error: expected ':' before ';' token
   14 | ????????u.x = ( t.x - s.x ) * cos(rad) - ( t.y - s.y ) * sin(rad) + s.x;
      |                                                                        ^
      |                                                                        :
main.c:15:1: error: expected expression before '?' token
   15 | ????????u.y = ( t.x - s.x ) * sin(rad) + ( t.y - s.y ) * cos(rad) + s.y;
      | ^
main.c:15:72: error: expected ':' before ';' token
   15 | ????????u.y = ( t.x - s.x ) * sin(rad) + ( t.y - s.y ) * cos(rad) + s.y;
      |                                                                        ^
      |                                                                        :
main.c:16:1: error: expected expression before '?' token
   16 | ??
      | ^
main.c:17:9: error: too few arguments to function 'koch'
   17 | ????????koch(n - 1, a, s);
      |         ^~~~
main.c:6:6: note: declared here
    6 | void koch(int n, struct point a, struct point b) {
      |      ^~~~
main.c:17:26: error: expected ':' before ';' token
   17 | ????????koch(n - 1, a, s);
      |                          ^
      |                          :
main.c:18:1: error: expected expression before '?' token
   18 | ????????if ( s.x < 0 ) s.x *= -1;
      | ^
main.c:19:1: error: expected expression before '?' token
   19 | ????????if ( s.y < 0 ) s.y *= -1;
      | ^
main.c:20:1: error: expected expression before '?' token
   20 | ????????printf("%.8f %.8f\n", s.x, s.y);
      | ^
main.c:21:1: error: expected expression before '?' token
   21 | ????????koch(n - 1, s, u);
      | ^
main.c:21:9: error: too few arguments to function 'koch'
   21 | ????????koch(n - 1, s, u);
      |         ^~~~
main.c:6:6: note: declared here
    6 | void koch(int n, struct point a, struct point b) {
      |      ^~~~
main.c:21:26: error: expected ':' before ';' token
   21 | ????????koch(n - 1, s, u);
      |                          ^
      |                          :
main.c:22:1: error: expected expression before '?' token
   22 | ????????if ( u.x < 0 ) u.x *= -1;
      | ^
main.c:23:1: error: expected expression before '?' token
   23 | ????????if ( u.y < 0 ) u.y *= -1;
      | ^
main.c:24:1: error: expected expression before '?' token
   24 | ????????printf("%.8f %.8f\n", u.x, u.y);
      | ^
main.c:25:1: error: expected expression before '?' token
   25 | ????????koch(n - 1, u, t);
      | ^
main.c:25:9: error: too few arguments to function 'koch'
   25 | ????????koch(n - 1, u, t);
      |         ^~~~
main.c:6:6: note: declared here
    6 | void koch(int n, struct point a, struct point b) {
      |      ^~~~
main.c:25:26: error: expected ':' before ';' token
   25 | ????????koch(n - 1, u, t);
      |                          ^
      |                          :
main.c:26:1: error: expected expression before '?' token
   26 | ????????if ( t.x < 0 ) t.x *= -1;
      | ^
main.c:27:1: error: expected expression before '?' token
   27 | ????????if ( t.y < 0 ) t.y *= -1;
      | ^
main.c:28:1: error: expected expression before '?' token
   28 | ????????printf("%.8f %.8f\n", t.x, t.y);
      | ^
main.c:29:1: error: expected expression before '?' token
   29 | ????????koch(n - 1, t, b);
      | ^
main.c:29:9: error: too few arguments to function 'koch'
   29 | ????????koch(n - 1, t, b);
      |         ^~~~
main.c:6:6: note: declared here
    6 | void koch(int n, struct point a, struct point b) {
      |      ^~~~
main.c:29:26: error: expected ':' before ';' token
   29 | ????????koch(n - 1, t, b);
      |                          ^
      |                          :
main.c: At top level:
main.c:31:1: error: expected identifier or '(' before '?' token
   31 | ??
      | ^