fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define MAXLEN 100
  5.  
  6. char toC(int x){
  7. char res = 0;
  8. int i;
  9. for(i = 0; i < 8; ++i) res |= x & (1<<i);
  10. return res;
  11. }
  12.  
  13. int main(int argc, char** argv){
  14. int i, j, k;
  15. int f[1<<16] = {};
  16. for(i = 1; i < argc; ++i){
  17. FILE *fp = fopen(argv[i], "r");
  18. char str[MAXLEN];
  19. fgets(str, MAXLEN, fp);
  20. for(j = 0; str[j]; ++j){
  21. int x = 0;
  22. for(k = 0; k < 8; ++k) x |= str[j] & (1<<k);
  23. if(str[j] < 0){
  24. x <<= 8;
  25. ++j;
  26. for(k = 0; k < 8; ++k) x |= str[j] & (1<<k);
  27. }
  28. f[x] = 1;
  29. }
  30. }
  31. for(i = 1; i < (1<<16); ++i){
  32. if(f[i] && i != '\n'){
  33. if(i >> 8) putchar(toC(i>>8));
  34. printf("%c\n", toC(i&0xFF));
  35. }
  36. }
  37. }
Success #stdin #stdout 0.02s 1844KB
stdin
Standard input is empty
stdout
Standard output is empty