fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main(void)
  5. {
  6.  
  7. char C1 = 'D', C2 = 'G';
  8. int N = 8, printCount = 1;
  9.  
  10.  
  11.  
  12. for (char c = C1; c <= C2 && printCount <= N; c++){
  13.  
  14. for (char b= C1; b <= C2 && printCount <= N; b++){
  15.  
  16. for (char d = C1; d <= C2 && printCount <= N; d++){
  17.  
  18. if (d != c && d!=b && b!=c){
  19. printf ("%c%c%c\n", c,b,d);
  20. printCount++;
  21. }
  22. }
  23. }
  24. }
  25.  
  26. return 0;
  27. }
  28.  
  29.  
Success #stdin #stdout 0s 2112KB
stdin
156
stdout
DEF
DEG
DFE
DFG
DGE
DGF
EDF
EDG