• Aucun résultat trouvé

(1)program telephone

N/A
N/A
Protected

Academic year: 2022

Partager "(1)program telephone"

Copied!
2
0
0

Texte intégral

(1)

program telephone;

uses wincrt;

var

n:string;

procedure numero (var n:string);

var

ch1,ch2:string;

begin

str(random(9000)+1000,ch1);

str(random(9000)+1000,ch2);

n:=ch1+ch2;

end;

function verif(ch:string):boolean;

var

i:integer;

test:boolean;

begin i:=0;

repeat i:=i+1;

test:=ch[i] in ['0'..'9'];

until (i=length(ch)) or (test=false);

verif:=test;

end;

Procedure affiche (VAR ch:string;n:string;chif:char);

begin

while (pos(chif,n)<>0) do begin

ch[pos(chif,n)]:=chif;

n[pos(chif,n)]:='X';

end;

writeln(ch);

end;

procedure devine (n:string);

var

nb:integer;

chif,rep:char;

trouve:integer;

ch,num:string;

begin

ch:='---';

nb:=0;

repeat nb:=nb+1;

repeat

write('Proposer un chiffre entre 0..9');

readln(chif);

until chif in ['0'..'9'];

affiche(ch,n,chif);

TROUVE:=0;

repeat

write('Voulez-vous proposer un numero ?');

readln(rep);

until rep in ['N','O'];

if rep='O' then begin

repeat

write('Proposer un Numero :');

readln(num);

(2)

until (length(num)=8) and (verif(num));

if num=n then trouve:=1 else

trouve:=2;

end;

until (nb=5)or ( trouve=2)OR (trouve=1);

if (trouve = 2) or (nb=5) then

writeln('Desole ! vous avez perdu ');

if (nb<=5) and (trouve=1) then

writeln('Bravo ! Vous avez gagne');

end;

begin numero(n);

writeln(n);

devine(n);

end.

Références

Documents relatifs

IT IS NECESSARY AT THE BEGINNING OF THE PROGRAM COR AT LEAST PRIOR TO THE LIBRARY OPEN COMMAND) TO SET THE LIMIT VIA THIS COMMAND IN ORDER TO DEFINE THE

When data cards contain information in a specific format observing a correlation between card columns and the variable fields, the fixed format input subroutines

LINC Reference Library Computer Systems Laboratory Washington University. 724

Dual Tone Multifrequency (DTMF) Signaling provides a method for pushbutton signaling from customer stations over the voice transmission path. The DTMF code

&gt; CONDUIRE UN ENTRETIEN TELEPHONIQUE &gt; ANALYSER LES BESOINS DU CLIENT &gt; CONTROLER LE CADRE DE LA NEGOCIAITON &gt; CONCLURE UNE VENTE &gt; GERER LE POST APPEL... Le

[r]

[r]

[r]