Update 21.10
							parent
							
								
									51bb1ca0d8
								
							
						
					
					
						commit
						88aa5c1e72
					
				|  | @ -66,6 +66,12 @@ public class Fakultät | ||||||
|         } |         } | ||||||
|       |       | ||||||
|     } |     } | ||||||
|  |     //Minumun suchen
 | ||||||
|  |     public static void A2 (){ | ||||||
|  |          | ||||||
|  |          | ||||||
|  |          | ||||||
|  | } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,41 @@ | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Beschreiben Sie hier die Klasse Zufallsgenerator. | ||||||
|  |  *  | ||||||
|  |  * @author (Ihr Name)  | ||||||
|  |  * @version (eine Versionsnummer oder ein Datum) | ||||||
|  |  */ | ||||||
|  | import java.util.Random; | ||||||
|  | public class Zufallsgenerator | ||||||
|  | { | ||||||
|  |     public static void A2(){ | ||||||
|  |          | ||||||
|  |         Random rand = new Random(); | ||||||
|  |         int[] arr = new int [20]; | ||||||
|  |         for( int a = 0; a<arr.length; a++){ | ||||||
|  |         arr[a]= rand.nextInt(50); | ||||||
|  |          | ||||||
|  |          | ||||||
|  |          | ||||||
|  |         } | ||||||
|  |         for(int b = 0 ; b<arr.length; b++){ | ||||||
|  |         System.out.print(arr[b]); | ||||||
|  |          | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |          | ||||||
|  |          | ||||||
|  |          | ||||||
|  |     } | ||||||
|  |     public static int min(int arr[]){ | ||||||
|  |     int min = arr[0]; | ||||||
|  |     int minindex = 0; | ||||||
|  |     for(int a = 0; a<arr.length; a++){ | ||||||
|  |     if( arr[a] < min){ | ||||||
|  |     min = arr[a]; | ||||||
|  |     minindex = a; | ||||||
|  |     } | ||||||
|  |     } | ||||||
|  |     return minindex; | ||||||
|  |     } | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue