Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void AcontidoEmB(double[] a, double[] b) {
- double aux[] = new double[a.length];
- int k = 0;
- boolean contido=true;
- for (int i = 0; i < a.length; i++) {
- boolean marcado = false;
- int j = 0;
- while (j < b.length && marcado != true) {
- if (a[i] == b[j]) {
- int percorre = 0;
- while (percorre < aux.length && marcado != true) {
- if (aux[percorre] == j) {
- marcado = true;
- }
- percorre++;
- }
- if (marcado != true) {
- aux[k] = j;
- k++;
- marcado = true;
- }
- }
- j++;
- }
- if (marcado != true) {
- contido=false;
- }
- }
- if(contido==true)
- System.out.println("A esta contido em B");
- else
- System.out.println("A não esta contido em B");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement