sexta-feira, 17 de novembro de 2017

//*******************************************************************
// Dear CompileJava users,
//
// CompileJava has been operating since 2013 completely free. If you
// find this site useful, or would otherwise like to contribute, then
// please consider a donation (link in 'More Info' tab) to support
// development of the new CompileJava website (stay tuned!).
//
// Most sincerely, Z.
//*******************************************************************

import java.lang.Math; // headers MUST be above the first class

// one class needs to have a main() method
public class HelloWorld
{
  static char[] C={'a', 'b', 'c'};
  static char[] R= {' ', ' ', ' '};
 
  static void combina (int m) {
    if (m==0) {
      System.out.println (R);
      return;
    }
    int i=0;
    while (i<C.length) {
      // tem combina
      //System.out.print (C[i]);
      R[m-1]=C[i];
      combina(m-1);
      i++;
    }
  }
 
  // arguments are passed using the text field below this editor
  public static void main(String[] args)
  {
    combina (3);
  }
}

Nenhum comentário:

Postar um comentário