منتديات معمورة لوف --- forum maamoura love
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


لو لم أكن معموري لتمنيت أن أكون معموري
 
الرئيسيةأحدث الصورالتسجيلدخول

 

 corection exercice 4 page 91

اذهب الى الأسفل 
2 مشترك
كاتب الموضوعرسالة
marouene

marouene


عدد الرسائل : 155
العمر : 35
الوصف الشخصى : sqw
تعيين الادارة : corection exercice 4 page 91 Nachit10
تاريخ التسجيل : 29/10/2008

corection exercice 4 page 91 Empty
مُساهمةموضوع: corection exercice 4 page 91   corection exercice 4 page 91 I_icon_minitimeالجمعة 28 نوفمبر - 1:27

program exe4p91;
uses wincrt;
var ch:string;
c:char;
function pair_c(ch:string;c:char;i,nb:integer):boolean;
begin
if length(ch)<2 then pair_c:=false
else if i>length(ch) then if nb mod 2=0 then pair_c:=true else pair_c:=false
else if ch[i]=c then pair_c:=pair_c(ch,c,i+1,nb+1)
else pair_c:=pair_c(ch,c,i+1,nb);
end;
begin
writeln('ch=');readln(ch);
writeln('caractere=');readln(c);
if pair_c(ch,c,1,0) then writeln(ch,' contient un nombre pair de ',c)
else writeln(ch,' ne contient pas un nombre pair de ',c)
end.
La fonction retourne un booléen car dans l’énonce on demande d’écrire une fonction qui teste si une chaîne contient un nombre pair de c.

{ solution de l'exercice tri insertion récursive d'un tableau }
program tri_insertion;
uses wincrt;
type tab = array[1..50]of integer;
var
t:tab;
n, i :integer;

procedure remplir(var t:tab;var n:integer);
begin
repeat
writeln('n=');readln(n);
until n in [2..50];
for i:= 1 to n do
begin
writeln('t[',i,']');
readln(t[i]);
end;
end;
procedure decaler(var t:tab;j,tmp:integer);
begin
if j>=1 then if t[j]> tmp then begin t[j+1]:=t[j] ;decaler(t,j-1,tmp);end else t[j+1]:=tmp
else t[j+1]:=tmp;
end;
procedure insertion(var t:tab;d,n:integer);
begin
if d<=n then begin if t[d] insertion(t,d+1,n);end;
end;
begin
remplir(t,n);
insertion(t,2,n);
for i:= 1 to n do
writeln('t[',i,']= ',t[i]);
end.

N.B : J’attends vos commentaires
الرجوع الى أعلى الصفحة اذهب الى الأسفل
mohamedhk2




عدد الرسائل : 103
العمر : 35
الوصف الشخصى : maamouri 7or
تعيين الادارة : corection exercice 4 page 91 Nachit10
تاريخ التسجيل : 18/11/2008

corection exercice 4 page 91 Empty
مُساهمةموضوع: رد: corection exercice 4 page 91   corection exercice 4 page 91 I_icon_minitimeالسبت 29 نوفمبر - 23:25

MERCIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
الرجوع الى أعلى الصفحة اذهب الى الأسفل
http://3w.sartimes2.com#3w.tunisia-sat.com
 
corection exercice 4 page 91
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
-
» specialement sur maamoura love correction d'exercice de livre N 14 page 71 sur 5 partie(partie N1)
» specialement sur maamoura love correction d'exercice de livre N 14 page 71 sur 5 partie(partie N2
» specialement sur maamoura love correction d'exercice de livre N 14 page 71 sur 5 partie(partie N3
» specialement sur maamoura love correction d'exercice de livre N 14 page 71 sur 5 partie(partie N4)
» specialement sur maamoura love correction d'exercice de livre N 14 page 71 sur 5 partie(partie N5)

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
منتديات معمورة لوف --- forum maamoura love :: الأقسام العامة :: Special BAC 2008/2009-
انتقل الى: