fork download
  1. #include <stdio.h>
  2. int main() {
  3. char buff[] = "ABBACACBBA", *p;
  4. while (*buff != '\0') {
  5. puts(buff);
  6. for (p = buff; p[1] != '\0'; p++) *p = *p == p[1] ? *p : 'A' + ((*p + p[1] - 2 * 'A') ^ 3);
  7. *p = '\0';
  8. }
  9. return 0;
  10. }
  11.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
ABBACACBBA
CBCBBBABC
AAABBCCA
AACBACB
ABACBA
CCBAC
CACB
BBA
BC
A