import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int array[] = new int[5];
System.out.println("Insert array elements:");
for (int i = 0; i < 5; i++) {
array[i] = input.nextInt();
}
System.out.print ("Inserted array elements:");
for (int i = 0; i < 5; i++) {
System.out.print (" " + array[i]);}
Scanner nput = new Scanner(System.in);
int Narray[] = new int[10];
System.out.println();
System.out.println("Insert array elements:");
for (int k = 0; k < 10; k++) {
Narray[k] = nput.nextInt();
}
System.out.print ("Inserted array elements:");
for (int k = 0; k < 10; k++) {
System.out.print (" " + Narray[k]); }
int l;
while(l=5){if (array[i]==Narray[k]){l=l+1;}else{l=l;};}
if (l=5){System.out.print ("yes");}else{System.out.print ("no");}
}
}
class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int array[] = new int[5];
System.out.println("Insert array elements:");
for (int i = 0; i < 5; i++) {
array[i] = input.nextInt();
}
System.out.print ("Inserted array elements:");
for (int i = 0; i < 5; i++) {
System.out.print (" " + array[i]);}
Scanner nput = new Scanner(System.in);
int Narray[] = new int[10];
System.out.println();
System.out.println("Insert array elements:");
for (int k = 0; k < 10; k++) {
Narray[k] = nput.nextInt();
}
System.out.print ("Inserted array elements:");
for (int k = 0; k < 10; k++) {
System.out.print (" " + Narray[k]); }
int l;
while(l=5){if (array[i]==Narray[k]){l=l+1;}else{l=l;};}
if (l=5){System.out.print ("yes");}else{System.out.print ("no");}
}
}
Комментариев нет:
Отправить комментарий