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

פורסם

מישהו יכול לתרגם לי בבקשה את הקטע לפסקל?

תודה.

[attachment deleted by admin]

פורסם

עד כמה שאני זוכר משנה שעברה:

procedure insert_kube(migdal_type ^m, char c);
var
k,j:integer;
begin

j = ^m.num;
if j<n-1 then
begin
for k:=j downto 0 do
begin
^m.a[k+1] := ^m.a[k];
^m.a[0] := ^m.a[c];
^m.num = ^m.num+1;
end;
end;

end;

procedure delete_kube(migdal_type ^m, char c);
var
k,j:integer;
begin

j = ^m.num;
if j>=1 then
begin
for k:=1 to j do
begin
^m.a[k-1] := ^m.a[k];
^m.num = ^m.num-1;
end;
end;

end;

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

ד"א כותבים cube ולא cube... (כתבתי kube כי זה שם הפונקציה פשוט :P)

פורסם
  • מחבר

מה זה M^? אין דבר כזה בפסקל.

אני הגדרתי ב- TYPE מערך חד מימדי בגודל 1..N מטיפוס STRING.

אתה יכול בבקשה לתרגם לי את הקטעים עם הנתונים שלי? כי אני לא מבין כמה דברים כמו j = ^m.num;

אני מצרף את התוכנית המלאה.

תודה רבה לך.

[attachment deleted by admin]

פורסם

בפסקל לא נהוג להעביר pointers אלא by var.

כלומר, למשל -

procedure insert_kube(var migdal_type m, char c)

ואם כבר מעבירים pointer, אז ההתייחסות אליו היא עם הכובע ("^") אחרי שם המשתנה ולא לפניו.

ארכיון

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

דיונים חדשים

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.