public class Tahed{ public static void main(String argumendid[]){ String[] m1=new String[100]; String[] m2=new String[100]; int loendur=0; int[] loendur1= new int[100]; String alfa[]={"a", "b", "c", "d", "e", "f", "g", "h", "i","j","k","l", "m","n", "o", "p", "r","s","t","u","v","x","y","z"}; for(int nr=0; nr<100; nr++){ int a=(int)(Math.random()*alfa.length); int b=(int)(Math.random()*alfa.length); m1[nr]=alfa[a]; m2[nr]=alfa[b]; } for(int nr=0; nr<100; nr++){ System.out.println(m1[nr]+m2[nr]); } for(int nr=1; nr<100; nr++){ if((m1[0]==m1[nr]) && (m2[0]==m2[nr])){ loendur++; } } for(int nr=0; nr<100; nr++){ for(int nr1=0; nr1<100; nr1++){ if((m1[nr]==m1[nr1]) && (m2[nr]==m2[nr1])){ loendur1[nr]++; } } } for(int nr=0; nr<100; nr++){ System.out.println("väärtus "+ m1[nr] +m2[nr] +" esineneb massiivis "+ loendur1[nr] +" kord(a)" ); } System.out.println("massiivi esimene väärtus on:" +m1[0]+m2[0]); System.out.println("see väärtus esineb massiivis veel " + loendur+ " kord(a)"); for(int nr=0; nr<100; nr++){ System.out.print(m1[nr] +m2[nr]+", "); } } }