Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Endlosschleife

Empfohlene Antworten

Veröffentlicht

Hallo,

ich sitze an meinem Programm (s.u.) und verzweifle... Es produziert eine Endlosschleife und ich finde den Knackpunkt nicht... Bitte helft mir schnell!!!

Vielen Dank im Voraus,

panisha

int[] txtzahlen = new int[max];

		txtzahlen[0] = 0;

		int i=1;

		int n = 1;

		int zeile;

		int test;



		while (i<=2){

			Random r = new Random();

			zeile = 1 + Math.abs(r.nextInt()) % max;    			             System.out.println("Zeile: " + zeile);

			System.out.println("txtzahlen[5]" + txtzahlen[5]);

			int y=0;

			while (y <=2) { 

				test = txtzahlen[y];

				System.out.println("test" + test);

				if (test == zeile) {

					System.out.println("yes" + y);

					break;

				} else {

					y = 0;

					System.out.println("no" + y);

				}

				y=y+1;

			}

			i=i+1;

		} 

aaaaaaaaaaahhhhhhhhhhhhh............:upps

genau das war's!!!

Ich hab die letzte Stunde diesen Code so oft umgeschrieben, dass ich den Wald vor lauter Bäumen nicht gesehen habe...

Vielen Dank :)

Jetzt geht's!

You made my day!!!

:D

Wünsche ein schönes WE...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.