עבור לתוכן
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.

בדיקת אורך של שורה וטור במערך דו מידמדי (מטריצה) בC# טעות מעצבנת:

Featured Replies

פורסם

יש לי את הפעולה הבאה שכל מטרת להדפיס את המערך הדו מימדי אבל יש לי איזו שהיא טעות

בבדיקת אורך שורה ואורך טור ואני לא מבין מה הבעיה (אל תתנו לי הצעות לכתוב 2 במקום כי זה אמור להיות קוד כללי)

int[,] a=new int [2,2];
a[0, 0] = 1;
a[0, 1] = 2;
a[1, 0] = 3;
a[1, 1] = 4;
int i,j,s,t;
s = a.Length(0);
t = a.Length(1);
for (i = 0; i <s; i++)
{
Console.WriteLine("");
for (j = 0; j < t; j++)
{
Console.Write(a[i, j]);
} }

הבעיה שלי בa.length שניהם מה לעזאזל לא נכון

אם משיהו לא הבין שיגיד כי זה דחוף לי

נ.ב השפה היא C#

פורסם

זה לא אמור להיות GetLength במקום Length ? ולמה הגדרת את המשתנים s ו t בדיוק ?

פורסם

a.GetLength(0)

a.GetLength(1)

אני לא זוכר במדויק אבל נראה לי הראשון זה השורות והשני זה העמודות

פורסם
  • מחבר

שניכם צודקים

נ.ב

סתם כי אין לי זין לכתוב כל פעם מחדש a.getlength

פורסם

יש מתודה שמחזירה לך את מספר האיברים הכללי של המערך,

תחלק אותו במספר הראשון שקיבלת ואותו תשמור למשתנה השני ותבדוק אם זה עובד.

ארכיון

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

דיונים חדשים

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.