Language: C

#include<stdio.h>
#include<string.h>




int main(void){
&#160; struct place{
&#160; &#160; char x,y,dir;
&#160; } now;
&#160; unsigned int m,n;
&#160; int k;
&#160; char input[32],command[16];




&#160; while(scanf("%u%u%*c",&m,&n) && m && n){
&#160; &#160; now=(struct place){1,1,0};
&#160; &#160;&#160;
&#160; &#160; while(scanf("%31[^\n]%*c",input) && strcmp(input,"STOP")){
&#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
	now.dir+=1;
	now.dir%=4;
	continue;
&#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
	now.dir+=3;
	now.dir%=4;
	continue;
&#160; &#160; &#160; }
&#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
&#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
&#160; &#160; &#160; if(now.dir%2){
	k*=(now.dir==3)?-1:1;
	now.x+=k;
	if(now.x<1) now.x=1;
	else if(now.x>m) now.x=m;
&#160; &#160; &#160; }else{
	k*=(now.dir==2)?-1:1;
	now.y+=k;
	if(now.y<1) now.y=1;
	else if(now.y>n) now.y=n;
&#160; &#160; &#160; }
&#160; &#160; }
&#160; &#160; printf("%d %d\n",now.x,now.y);
&#160; }
&#160; return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:2: error: stray '#' in program
    8 | &#160; struct place{
      |  ^
main.c:8:1: error: lvalue required as unary '&' operand
    8 | &#160; struct place{
      | ^
main.c:9:1: error: expected specifier-qualifier-list before '&' token
    9 | &#160; &#160; char x,y,dir;
      | ^
main.c:9:2: error: stray '#' in program
    9 | &#160; &#160; char x,y,dir;
      |  ^
main.c:9:9: error: stray '#' in program
    9 | &#160; &#160; char x,y,dir;
      |         ^
main.c:10:2: error: stray '#' in program
   10 | &#160; } now;
      |  ^
main.c:11:2: error: stray '#' in program
   11 | &#160; unsigned int m,n;
      |  ^
main.c:11:1: error: lvalue required as unary '&' operand
   11 | &#160; unsigned int m,n;
      | ^
main.c:12:2: error: stray '#' in program
   12 | &#160; int k;
      |  ^
main.c:12:1: error: lvalue required as unary '&' operand
   12 | &#160; int k;
      | ^
main.c:13:2: error: stray '#' in program
   13 | &#160; char input[32],command[16];
      |  ^
main.c:13:1: error: lvalue required as unary '&' operand
   13 | &#160; char input[32],command[16];
      | ^
main.c:18:2: error: stray '#' in program
   18 | &#160; while(scanf("%u%u%*c",&m,&n) && m && n){
      |  ^
main.c:18:1: error: lvalue required as unary '&' operand
   18 | &#160; while(scanf("%u%u%*c",&m,&n) && m && n){
      | ^
main.c:19:2: error: stray '#' in program
   19 | &#160; &#160; now=(struct place){1,1,0};
      |  ^
main.c:19:1: error: lvalue required as unary '&' operand
   19 | &#160; &#160; now=(struct place){1,1,0};
      | ^
main.c:19:9: error: stray '#' in program
   19 | &#160; &#160; now=(struct place){1,1,0};
      |         ^
main.c:19:8: error: lvalue required as unary '&' operand
   19 | &#160; &#160; now=(struct place){1,1,0};
      |        ^
main.c:19:34: warning: excess elements in struct initializer
   19 | &#160; &#160; now=(struct place){1,1,0};
      |                                  ^
main.c:19:34: note: (near initialization for '(anonymous)')
main.c:19:36: warning: excess elements in struct initializer
   19 | &#160; &#160; now=(struct place){1,1,0};
      |                                    ^
main.c:19:36: note: (near initialization for '(anonymous)')
main.c:19:38: warning: excess elements in struct initializer
   19 | &#160; &#160; now=(struct place){1,1,0};
      |                                      ^
main.c:19:38: note: (near initialization for '(anonymous)')
main.c:20:2: error: stray '#' in program
   20 | &#160; &#160;&#160;
      |  ^
main.c:20:1: error: lvalue required as unary '&' operand
   20 | &#160; &#160;&#160;
      | ^
main.c:20:9: error: stray '#' in program
   20 | &#160; &#160;&#160;
      |         ^
main.c:20:8: error: lvalue required as unary '&' operand
   20 | &#160; &#160;&#160;
      |        ^
main.c:20:15: error: stray '#' in program
   20 | &#160; &#160;&#160;
      |               ^
main.c:20:14: error: lvalue required as unary '&' operand
   20 | &#160; &#160;&#160;
      |              ^
main.c:21:2: error: stray '#' in program
   21 | &#160; &#160; while(scanf("%31[^\n]%*c",input) && strcmp(input,"STOP")){
      |  ^
main.c:21:1: error: lvalue required as unary '&' operand
   21 | &#160; &#160; while(scanf("%31[^\n]%*c",input) && strcmp(input,"STOP")){
      | ^
main.c:21:9: error: stray '#' in program
   21 | &#160; &#160; while(scanf("%31[^\n]%*c",input) && strcmp(input,"STOP")){
      |         ^
main.c:21:8: error: lvalue required as unary '&' operand
   21 | &#160; &#160; while(scanf("%31[^\n]%*c",input) && strcmp(input,"STOP")){
      |        ^
main.c:22:2: error: stray '#' in program
   22 | &#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
      |  ^
main.c:22:1: error: lvalue required as unary '&' operand
   22 | &#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
      | ^
main.c:22:9: error: stray '#' in program
   22 | &#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
      |         ^
main.c:22:8: error: lvalue required as unary '&' operand
   22 | &#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
      |        ^
main.c:22:16: error: stray '#' in program
   22 | &#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
      |                ^
main.c:22:15: error: lvalue required as unary '&' operand
   22 | &#160; &#160; &#160; if(!strcmp(input,"RIGHT")){
      |               ^
main.c:23:12: error: 'struct place' has no member named 'dir'
   23 |         now.dir+=1;
      |            ^
main.c:24:12: error: 'struct place' has no member named 'dir'
   24 |         now.dir%=4;
      |            ^
main.c:26:2: error: stray '#' in program
   26 | &#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
      |  ^
main.c:26:1: error: lvalue required as unary '&' operand
   26 | &#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
      | ^
main.c:26:9: error: stray '#' in program
   26 | &#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
      |         ^
main.c:26:8: error: lvalue required as unary '&' operand
   26 | &#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
      |        ^
main.c:26:16: error: stray '#' in program
   26 | &#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
      |                ^
main.c:26:15: error: lvalue required as unary '&' operand
   26 | &#160; &#160; &#160; }else if(!strcmp(input,"LEFT")){
      |               ^
main.c:27:12: error: 'struct place' has no member named 'dir'
   27 |         now.dir+=3;
      |            ^
main.c:28:12: error: 'struct place' has no member named 'dir'
   28 |         now.dir%=4;
      |            ^
main.c:30:2: error: stray '#' in program
   30 | &#160; &#160; &#160; }
      |  ^
main.c:30:1: error: lvalue required as unary '&' operand
   30 | &#160; &#160; &#160; }
      | ^
main.c:30:9: error: stray '#' in program
   30 | &#160; &#160; &#160; }
      |         ^
main.c:30:8: error: lvalue required as unary '&' operand
   30 | &#160; &#160; &#160; }
      |        ^
main.c:30:16: error: stray '#' in program
   30 | &#160; &#160; &#160; }
      |                ^
main.c:30:15: error: lvalue required as unary '&' operand
   30 | &#160; &#160; &#160; }
      |               ^
main.c:31:2: error: stray '#' in program
   31 | &#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
      |  ^
main.c:31:1: error: lvalue required as unary '&' operand
   31 | &#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
      | ^
main.c:31:9: error: stray '#' in program
   31 | &#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
      |         ^
main.c:31:8: error: lvalue required as unary '&' operand
   31 | &#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
      |        ^
main.c:31:16: error: stray '#' in program
   31 | &#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
      |                ^
main.c:31:15: error: lvalue required as unary '&' operand
   31 | &#160; &#160; &#160; sscanf(input,"%15s%d",command,&k);
      |               ^
main.c:32:2: error: stray '#' in program
   32 | &#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
      |  ^
main.c:32:1: error: lvalue required as unary '&' operand
   32 | &#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
      | ^
main.c:32:9: error: stray '#' in program
   32 | &#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
      |         ^
main.c:32:8: error: lvalue required as unary '&' operand
   32 | &#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
      |        ^
main.c:32:16: error: stray '#' in program
   32 | &#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
      |                ^
main.c:32:15: error: lvalue required as unary '&' operand
   32 | &#160; &#160; &#160; if(!strcmp(command,"BACKWARD")) k*=-1;
      |               ^
main.c:33:2: error: stray '#' in program
   33 | &#160; &#160; &#160; if(now.dir%2){
      |  ^
main.c:33:1: error: lvalue required as unary '&' operand
   33 | &#160; &#160; &#160; if(now.dir%2){
      | ^
main.c:33:9: error: stray '#' in program
   33 | &#160; &#160; &#160; if(now.dir%2){
      |         ^
main.c:33:8: error: lvalue required as unary '&' operand
   33 | &#160; &#160; &#160; if(now.dir%2){
      |        ^
main.c:33:16: error: stray '#' in program
   33 | &#160; &#160; &#160; if(now.dir%2){
      |                ^
main.c:33:15: error: lvalue required as unary '&' operand
   33 | &#160; &#160; &#160; if(now.dir%2){
      |               ^
main.c:33:28: error: 'struct place' has no member named 'dir'
   33 | &#160; &#160; &#160; if(now.dir%2){
      |                            ^
main.c:34:16: error: 'struct place' has no member named 'dir'
   34 |         k*=(now.dir==3)?-1:1;
      |                ^
main.c:35:12: error: 'struct place' has no member named 'x'
   35 |         now.x+=k;
      |            ^
main.c:36:15: error: 'struct place' has no member named 'x'
   36 |         if(now.x<1) now.x=1;
      |               ^
main.c:36:24: error: 'struct place' has no member named 'x'
   36 |         if(now.x<1) now.x=1;
      |                        ^
main.c:37:20: error: 'struct place' has no member named 'x'
   37 |         else if(now.x>m) now.x=m;
      |                    ^
main.c:37:29: error: 'struct place' has no member named 'x'
   37 |         else if(now.x>m) now.x=m;
      |                             ^
main.c:38:2: error: stray '#' in program
   38 | &#160; &#160; &#160; }else{
      |  ^
main.c:38:1: error: lvalue required as unary '&' operand
   38 | &#160; &#160; &#160; }else{
      | ^
main.c:38:9: error: stray '#' in program
   38 | &#160; &#160; &#160; }else{
      |         ^
main.c:38:8: error: lvalue required as unary '&' operand
   38 | &#160; &#160; &#160; }else{
      |        ^
main.c:38:16: error: stray '#' in program
   38 | &#160; &#160; &#160; }else{
      |                ^
main.c:38:15: error: lvalue required as unary '&' operand
   38 | &#160; &#160; &#160; }else{
      |               ^
main.c:39:16: error: 'struct place' has no member named 'dir'
   39 |         k*=(now.dir==2)?-1:1;
      |                ^
main.c:40:12: error: 'struct place' has no member named 'y'
   40 |         now.y+=k;
      |            ^
main.c:41:15: error: 'struct place' has no member named 'y'
   41 |         if(now.y<1) now.y=1