Skip to content

Instantly share code, notes, and snippets.

@caiquecastro
Created August 18, 2014 16:23
Show Gist options
  • Save caiquecastro/b33f3c995e1a33b7dc80 to your computer and use it in GitHub Desktop.
Save caiquecastro/b33f3c995e1a33b7dc80 to your computer and use it in GitHub Desktop.
Exercicio Matemática Discreta - Tamanho de Conjuntos
public class Ex2 {
public static void main(String[] args) {
Conjunto a = new Conjunto("A"),
b = new Conjunto("B");
a.init();
b.init();
int sizeA = a.tamanho(),
sizeB = b.tamanho();
System.out.println("|A| = " + sizeA);
System.out.println("|B| = " + sizeA);
System.out.printf("|2^A| = %.0f\n", Math.pow(2, sizeA));
System.out.println("|A x B| = " + sizeA * sizeB);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment