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

פורסם

מצאתי את הפתרון.

for(i=0;i<num;i++)
{n=rand()%(N+1);
if(ar[n]==1)n=rand()%(N+1);

החלפתי את המספרים לערכים בינאריים.

תודה

אפשר לנעול

פורסם

א. תדאג להזחה נכונה של הקוד, כי ככה קשה לקרוא אותו.

ב. תדאג לשים סוגריים מסולסלים בכל if ו-for, כי זה גם מקל על קריאת הקוד וגם עוזר להגן מפני באגים.

ג. לא כל כך הבנתי את הדרישות של הפונקציה. אתה מתייחס אל המערך כאילו הוא בגודל num (שהוא מספר אקראי), אבל שם בו ערכים מ-1 עד N? חוץ מזה, זה בעייתי להתייחס למערך בגודל אקראי - אתה צריך לדעת את גודל המערך מראש (מאיפה מגיע המערך הזה בכלל?)

ומה זה F_check?

ארכיון

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

דיונים חדשים

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.