Forum > Arabic
شاركـ ببرنامج
Al-Eid:
السلام عليكم
هذا برنامج لترتيب مصفوفة
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- program forloop;uses crt;var a:array[1..10]of byte; temp:byte; i,k:byte;begin clrscr; (*fill the array with random numbers*) WriteLn('fill the array with random numbers : '); for i:=1 to 10 dobegin ReadLn(a[i]); //random(100)+1 end; (*short the numbers of the array a*) for i:=1 to 9 dobegin for k:=i+1 to 10 do begin if a[i] > a[k] thenbegin temp:=a[i]; a[i]:=a[k]; a[k]:=temp; end; end;end; writeln; writeln('shorted results: '); (*write the result to the screen*) for i:=1 to 10 do begin write(a[i],','); end; writeln; (*press any key to quit*) while not keypressed do continue;end.(*created by FlamingClaw 2010.02.04.*)
pascal111:
--- Quote from: Al-Eid on October 27, 2021, 03:11:34 pm ---السلام عليكم
في الحقيقة هذا ليس برنامج ولكنه عبارة عن كود صغير وجدته في الأنترنت وأردت أن أنشره في هذا الموضوع
يعمل هذا الكود مع أداة DBNavigator بحيث يقوم بسؤال المستخدم على تأكيد عملية الحذف
أولا نجعل قيمة الخاصية ConfirmDelete تساوي False للأداة DBNavigator
وفي الحدث BeforeDelete للأداة SQLQuery نكتب الكود التالي
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- if MessageDlg('تحذير','هل أنت متأكد من حذف',mtWarning,mbYesNo,0)<> mrYes then Abort else if MessageDlg('تأكيد','للتأكيد مرة ثانية'+#13+'هل أنت متأكد من حذف',mtWarning,mbYesNo,0)<> mrYes then Abort ;
--- End quote ---
إستخدام جيّد جدّاً لأساليب البرمجة المرئيّه ،أتكلّم من واقع خبرتي مع البرمجة في بيئة الـ DOS
pascal111:
--- Quote from: Al-Eid on November 24, 2021, 12:01:46 pm ---السلام عليكم
هذا برنامج لترتيب مصفوفة
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- program forloop;uses crt;var a:array[1..10]of byte; temp:byte; i,k:byte;begin clrscr; (*fill the array with random numbers*) WriteLn('fill the array with random numbers : '); for i:=1 to 10 dobegin ReadLn(a[i]); //random(100)+1 end; (*short the numbers of the array a*) for i:=1 to 9 dobegin for k:=i+1 to 10 do begin if a[i] > a[k] thenbegin temp:=a[i]; a[i]:=a[k]; a[k]:=temp; end; end;end; writeln; writeln('shorted results: '); (*write the result to the screen*) for i:=1 to 10 do begin write(a[i],','); end; writeln; (*press any key to quit*) while not keypressed do continue;end.(*created by FlamingClaw 2010.02.04.*)
--- End quote ---
منطق ممتاز!
Navigation
[0] Message Index
[*] Previous page