Talk:AAAAAAAAAAAAAAaaaaaaaaaEEEEEEEaaaaaaaaaaaa Source
Jump to navigation
Jump to search
#include <stdio.h> int main() { int cmd, dat, pc, extend = 0; char program[1000], memory[26] = { 0 }; gets(program); for (pc = 0; program[pc] > 0; ++pc) { cmd = program[pc]; dat = program[pc + 1]; if (extend) { if (cmd > 93) { --extend; ++pc; continue; } if (dat == 0) program[pc] = -1; } if (cmd > 96) memory[cmd - 97]--; else if (cmd > 95) memory[dat - 65] = getchar(); else if (cmd > 94) putchar(memory[dat - 65]); else if (cmd > 93 && memory[dat - 65] == 0) extend = 1; else if (cmd > 64) memory[cmd - 65]++; } }