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

פורסם

דבר מסובך לאללה :silly:

מי מסביר לי את הקטע הבא:

public static int MysterySum(int n)
{
if (n==1)
return 1;
int sum = n;
for (int i=1; i<n; i++)
sum = sum + MysterySum(i);
return sum;
}

:nixweiss:

תודה מראש

פורסם

לפי מה שאני רואה בכללי

הפעולה מחברת את כל מה שבא לפני המספר n

כלומר אם המספר n=5 אז הפעולה מחברת 1+2+3+4+5

עריכה: זה לא נכן, בדקתי בbluej

נגיד ל n=3 זה נתן לי 7

ול-n=5 זה נתן לי 31

פורסם

שימו לב שעבור n מסוים, הפונקציה לא רק קוראת לעצמה עבור n-1, אלא עבור כל המספרים מ-1 עד n-1.

פורסם
:screwy:
פורסם

Uוואעיייי הבנתייייייי

אחרי שעהההה

מה מצפה לי בהמשך יא אללה..

תודה על העזרה 8)

פורסם

אם זה ממש קשה אתה יכול להוסיף WRITELINE ולראות את ההדפסות.

פורסם

עבור 3:

sum = 3 + MysterySum(2) + MysterySum(1)

=3+2+MysterySum(1)+1

=7

ארכיון

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

דיונים חדשים

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.