solution.c (325B)
1 #include <stdio.h> 2 3 int main() 4 { 5 char memory[256], token[256]; 6 int position = 0, value; 7 8 while(scanf("%s", token) == 1 ) { 9 if (token[0] == '>') { 10 ++position; 11 } else if (token[0] == '<') { 12 --position; 13 } else { 14 memory[position] = atoi(token); 15 } 16 } 17 18 printf("Memory:\n%s\n", memory); 19 }