fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6. char s[2][10];
  7. int len, n = 1, i, j, t;
  8. printf("input = ");
  9. scanf("%s", s[0]);
  10. len = strlen(s[0]);
  11. for ( i = 0; i < len; ++i) {
  12. s[1][i] = s[0][i] - 'a' + 'A';
  13. n *= 2;
  14. }
  15. printf("%d %d %s\n", len, n, s[1]);
  16. for ( i = 0; i < n; ++i) {
  17. t = i;
  18. for ( j = 0; j < len; ++j) {
  19. putchar(t & 0x1 ? s[1][j] : s[0][j]);
  20. t >>= 1;
  21. }
  22. putchar('\n');
  23. }
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0.01s 1680KB
stdin
qwe
stdout
input = 3 8 QWE/��,޿�޿�/��P�0��޿%�s�P�0��޿%�s�
qwe
Qwe
qWe
QWe
qwE
QwE
qWE
QWE