Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int e(char*v){int c=0,p=0;
- char d[4096];while(v[c]){switch
- (v[c]){case '>':p++;break;
- case'<':p
- --;break;
- case'+':d[p]++;break;
- case'-':d[p]--;break;case'.':
- putchar(d[p]);break;case',':d[p
- ]=getchar();break;case'[':if(!d[
- p]){int s=1 ;while(s+=
- v[++c]=='[' ?1:v[c]==
- ']'?-1:0); }break;case
- ']':if(d[p ]){int s=1;
- while(s+= v[--c]==']'?
- 1:v[c]=='[' ?-1:0);}break;
- default:c--;break;}c++;}}int
- main(int n,char**v) {if(n!=2)
- return 1;e (v[1]);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement