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

פורסם

תוכן נמחק

פורסם

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

לגבי להריץ קוד ולראות את ערכי המשתנים בכל פקודה , אתה יכול לחפש על זה באינטרנט - visual studio debug

 class Program
{
static int [] places;

int returnValidSeat(int choice)
{
int freeSpaceUp = -1; //index to search for free space down
int freeSpaceDown = -1;//index to search for free space up
if (places[choice] == 0) // if the seat is empty return the seat number
// u need to change places[choice] to different number than 0
{
return choice;
}
else{
for(int i=0;i<places.Length;i++){//check for free place up
if(places[choice+i]==0){
freeSpaceUp = choice+i;
}
}
for (int j = 0; choice - j > 0; j++)//check for free place down
{
if(places[choice-j]==0){
freeSpaceDown = choice-j;
}
}
}
// u need also check if freeSpaceUp freeSpaceDown are still -1 --> they didn't found empty place
return min(freeSpaceUp - choice, choice - freeSpaceDown);


}

ארכיון

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

דיונים חדשים

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.