Language: C++

#include <stdio.h>
#include <math.h>
&#160;
void walk(double current_point[2], int r, int sum_theta) {
&#160; &#160; double pi = 3.14159265358979;&#160;
&#160; &#160; double rad = ((double)sum_theta / 180) * pi;
&#160; &#160; current_point[0] += r * sin(rad);
&#160; &#160; current_point[1] += r * cos(rad);
}
&#160;
int main() {
&#160; &#160; int r;
&#160; &#160; int theta;
&#160; &#160; int sum_theta = 0;
&#160; &#160; double current_point[2] = {0, 0};
&#160;
&#160; &#160; do {
&#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
&#160;
&#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
&#160; &#160; &#160; &#160; sum_theta += theta;
&#160; &#160; } while(r || theta);
&#160;
&#160; &#160; printf("%d\n", (int)current_point[0]);
&#160; &#160; printf("%d\n", (int)current_point[1]);
&#160;
&#160; &#160; return 0;
}

Compiler output:
a.cc:3:2: error: stray '#' in program
    3 | &#160;
      |  ^
a.cc:5:2: error: stray '#' in program
    5 | &#160; &#160; double pi = 3.14159265358979;&#160;
      |  ^
a.cc:5:9: error: stray '#' in program
    5 | &#160; &#160; double pi = 3.14159265358979;&#160;
      |         ^
a.cc:5:45: error: stray '#' in program
    5 | &#160; &#160; double pi = 3.14159265358979;&#160;
      |                                             ^
a.cc:6:2: error: stray '#' in program
    6 | &#160; &#160; double rad = ((double)sum_theta / 180) * pi;
      |  ^
a.cc:6:9: error: stray '#' in program
    6 | &#160; &#160; double rad = ((double)sum_theta / 180) * pi;
      |         ^
a.cc:7:2: error: stray '#' in program
    7 | &#160; &#160; current_point[0] += r * sin(rad);
      |  ^
a.cc:7:9: error: stray '#' in program
    7 | &#160; &#160; current_point[0] += r * sin(rad);
      |         ^
a.cc:8:2: error: stray '#' in program
    8 | &#160; &#160; current_point[1] += r * cos(rad);
      |  ^
a.cc:8:9: error: stray '#' in program
    8 | &#160; &#160; current_point[1] += r * cos(rad);
      |         ^
a.cc:10:2: error: stray '#' in program
   10 | &#160;
      |  ^
a.cc:12:2: error: stray '#' in program
   12 | &#160; &#160; int r;
      |  ^
a.cc:12:9: error: stray '#' in program
   12 | &#160; &#160; int r;
      |         ^
a.cc:13:2: error: stray '#' in program
   13 | &#160; &#160; int theta;
      |  ^
a.cc:13:9: error: stray '#' in program
   13 | &#160; &#160; int theta;
      |         ^
a.cc:14:2: error: stray '#' in program
   14 | &#160; &#160; int sum_theta = 0;
      |  ^
a.cc:14:9: error: stray '#' in program
   14 | &#160; &#160; int sum_theta = 0;
      |         ^
a.cc:15:2: error: stray '#' in program
   15 | &#160; &#160; double current_point[2] = {0, 0};
      |  ^
a.cc:15:9: error: stray '#' in program
   15 | &#160; &#160; double current_point[2] = {0, 0};
      |         ^
a.cc:16:2: error: stray '#' in program
   16 | &#160;
      |  ^
a.cc:17:2: error: stray '#' in program
   17 | &#160; &#160; do {
      |  ^
a.cc:17:9: error: stray '#' in program
   17 | &#160; &#160; do {
      |         ^
a.cc:18:2: error: stray '#' in program
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |  ^
a.cc:18:9: error: stray '#' in program
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |         ^
a.cc:18:16: error: stray '#' in program
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |                ^
a.cc:18:23: error: stray '#' in program
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |                       ^
a.cc:19:2: error: stray '#' in program
   19 | &#160;
      |  ^
a.cc:20:2: error: stray '#' in program
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |  ^
a.cc:20:9: error: stray '#' in program
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |         ^
a.cc:20:16: error: stray '#' in program
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |                ^
a.cc:20:23: error: stray '#' in program
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |                       ^
a.cc:21:2: error: stray '#' in program
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |  ^
a.cc:21:9: error: stray '#' in program
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |         ^
a.cc:21:16: error: stray '#' in program
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |                ^
a.cc:21:23: error: stray '#' in program
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |                       ^
a.cc:22:2: error: stray '#' in program
   22 | &#160; &#160; } while(r || theta);
      |  ^
a.cc:22:9: error: stray '#' in program
   22 | &#160; &#160; } while(r || theta);
      |         ^
a.cc:23:2: error: stray '#' in program
   23 | &#160;
      |  ^
a.cc:24:2: error: stray '#' in program
   24 | &#160; &#160; printf("%d\n", (int)current_point[0]);
      |  ^
a.cc:24:9: error: stray '#' in program
   24 | &#160; &#160; printf("%d\n", (int)current_point[0]);
      |         ^
a.cc:25:2: error: stray '#' in program
   25 | &#160; &#160; printf("%d\n", (int)current_point[1]);
      |  ^
a.cc:25:9: error: stray '#' in program
   25 | &#160; &#160; printf("%d\n", (int)current_point[1]);
      |         ^
a.cc:26:2: error: stray '#' in program
   26 | &#160;
      |  ^
a.cc:27:2: error: stray '#' in program
   27 | &#160; &#160; return 0;
      |  ^
a.cc:27:9: error: stray '#' in program
   27 | &#160; &#160; return 0;
      |         ^
a.cc:3:3: error: expected unqualified-id before numeric constant
    3 | &#160;
      |   ^~~
a.cc: In function 'void walk(double*, int, int)':
a.cc:5:3: error: lvalue required as unary '&' operand
    5 | &#160; &#160; double pi = 3.14159265358979;&#160;
      |   ^~~
a.cc:5:10: error: lvalue required as unary '&' operand
    5 | &#160; &#160; double pi = 3.14159265358979;&#160;
      |          ^~~
a.cc:5:46: error: lvalue required as unary '&' operand
    5 | &#160; &#160; double pi = 3.14159265358979;&#160;
      |                                              ^~~
a.cc:6:3: error: lvalue required as unary '&' operand
    6 | &#160; &#160; double rad = ((double)sum_theta / 180) * pi;
      |   ^~~
a.cc:6:10: error: lvalue required as unary '&' operand
    6 | &#160; &#160; double rad = ((double)sum_theta / 180) * pi;
      |          ^~~
a.cc:7:3: error: lvalue required as unary '&' operand
    7 | &#160; &#160; current_point[0] += r * sin(rad);
      |   ^~~
a.cc:7:10: error: lvalue required as unary '&' operand
    7 | &#160; &#160; current_point[0] += r * sin(rad);
      |          ^~~
a.cc:8:3: error: lvalue required as unary '&' operand
    8 | &#160; &#160; current_point[1] += r * cos(rad);
      |   ^~~
a.cc:8:10: error: lvalue required as unary '&' operand
    8 | &#160; &#160; current_point[1] += r * cos(rad);
      |          ^~~
a.cc: At global scope:
a.cc:10:3: error: expected unqualified-id before numeric constant
   10 | &#160;
      |   ^~~
a.cc: In function 'int main()':
a.cc:12:3: error: lvalue required as unary '&' operand
   12 | &#160; &#160; int r;
      |   ^~~
a.cc:12:10: error: lvalue required as unary '&' operand
   12 | &#160; &#160; int r;
      |          ^~~
a.cc:13:3: error: lvalue required as unary '&' operand
   13 | &#160; &#160; int theta;
      |   ^~~
a.cc:13:10: error: lvalue required as unary '&' operand
   13 | &#160; &#160; int theta;
      |          ^~~
a.cc:14:3: error: lvalue required as unary '&' operand
   14 | &#160; &#160; int sum_theta = 0;
      |   ^~~
a.cc:14:10: error: lvalue required as unary '&' operand
   14 | &#160; &#160; int sum_theta = 0;
      |          ^~~
a.cc:15:3: error: lvalue required as unary '&' operand
   15 | &#160; &#160; double current_point[2] = {0, 0};
      |   ^~~
a.cc:15:10: error: lvalue required as unary '&' operand
   15 | &#160; &#160; double current_point[2] = {0, 0};
      |          ^~~
a.cc:16:3: error: lvalue required as unary '&' operand
   16 | &#160;
      |   ^~~
a.cc:17:3: error: lvalue required as unary '&' operand
   17 | &#160; &#160; do {
      |   ^~~
a.cc:17:10: error: lvalue required as unary '&' operand
   17 | &#160; &#160; do {
      |          ^~~
a.cc:18:3: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |   ^~~
a.cc:18:10: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |          ^~~
a.cc:18:17: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |                 ^~~
a.cc:18:24: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; &#160; scanf("%d,%d", &r, &theta);
      |                        ^~~
a.cc:19:3: error: lvalue required as unary '&' operand
   19 | &#160;
      |   ^~~
a.cc:20:3: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |   ^~~
a.cc:20:10: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |          ^~~
a.cc:20:17: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |                 ^~~
a.cc:20:24: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; &#160; walk(current_point, r, sum_theta);
      |                        ^~~
a.cc:21:3: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |   ^~~
a.cc:21:10: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |          ^~~
a.cc:21:17: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |                 ^~~
a.cc:21:24: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; &#160; sum_theta += theta;
      |                        ^~~
a.cc:22:3: error: lvalue required as unary '&' operand
   22 | &#160; &#160; } while(r || theta);
      |   ^~~
a.cc:22:10: error: lvalue required as unary '&' operand
   22 | &#160; &#160; } while(r || theta);
      |          ^~~
a.cc:23:3: error: lvalue required as unary '&' operand
   23 | &#160;
      |   ^~~
a.cc:24:3: error: lvalue required as unary '&' operand
   24 | &#160; &#160; printf("%d\n", (int)current_point[0]);
      |   ^~~
a.cc:24:10: error: lvalue required as unary '&' operand
   24 | &#160; &#160; printf("%d\n", (int)current_point[0]);
      |          ^~~
a.cc:25:3: error: lvalue required as unary '&' operand
   25 | &#160; &#160; printf("%d\n", (int)current_point[1]);
      |   ^~~
a.cc:25:10: error: lvalue required as unary '&' operand
   25 | &#160; &#160; printf("%d\n", (int)current_point[1]);
      |          ^~~
a.cc:26:3: error: lvalue required as unary '&' operand
   26 | &#160;
      |   ^~~
a.cc:27:3: error: lvalue required as unary '&' operand
   27 | &#160; &#160; return 0;
      |   ^~~
a.cc:27:10: error: lvalue required