עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

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.

הפיכת מערך דו מימדי נגד כיוון השעון

Featured Replies

פורסם

אני צריך להפוך מערך דו מימדי פעם אחת נגד כיוון השעון ולהחזיר את המערך החדש.

עשיתי משהו אבל יש לי באג ואני לא מצליח להבין מהו (בעיקרון אני יוצא מגבולות המערך אבל אני לא מצליח לגלות איפה):

_matrix זה המערך הדו מימדי הישן שלי.

	public Matrix rotate()
{
int row = _matrix.length;
int col = _matrix[0].length;

Matrix newArr = new Matrix(col, row);


for (int i = 0; i < _matrix.length; i++)
{
for (int j = _matrix[0].length - 1; j >= 0; j--)
{
newArr._matrix[i][_matrix[0].length - 1 - j] = _matrix[i][j];
}
}

return newArr;
}

פורסם
  • מחבר

כן אין בעיה אני רואה שאם המערך הישן הוא 3 על 2 אז החדש הוא 2 על 3 (כי כשמסובבים את המערך מימדי התמונה משתנים)

פורסם
  • מחבר

בהתחלה אני צריך להכניס את אפס ושלוש (i ו-j) לתוך אפס ואפס - עובד

אח"כ אפס ושתיים לתוך אפס ואחד - קורה

אח"כ אפס ואחד לתוך אפס ושתיים - קורה

אח"כ זה מוזר כי זה נשאר על אפס ואחד ולא יורד לאפס ואפס

פורסם
אח"כ אפס ושתיים לתוך אפס ואחד - קורה

אח"כ אפס ואחד לתוך אפס ושתיים - קורה

יש לך טעות כאן. תחשוב על זה.

פורסם
  • מחבר

זהו שאני לא עולה על זה

פורסם
  • מחבר

אחד אפס

פורסם
  • מחבר

:kopfpatsch:

תודה רבה.

נערך על-ידי falukky

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

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.