1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| program Telephone;
uses crt;
var
s:string;
i,k,j:byte;
Function BalayageIn(chaine:string):string;
var Resultat:string;
IndexChaine, IndexResultat: byte;
Begin
IndexChaine := 1;
IndexResultat := 0;
while IndexChaine <= Length(chaine) do
begin
if not (Chaine[IndexChaine] in [#0..#47,#58..#64,#91..#96,#123..#255])
then
begin;
Inc(IndexResultat);;
Resultat[IndexResultat] := Chaine[IndexChaine];
end;
Inc(IndexChaine);
end;
Resultat[0] := Char(IndexResultat);
BalayageIn := Resultat;
End;
Procedure Test(f:string);
var n:byte;
Begin
if length(f)<10 then
writeln('Pas assez de chiffre ! ')
else
if length(f)>10 then
writeln('Trop de chiffre ! ')
End;
Procedure Format_Points(var t:string; a:string);
begin
{
a:='.';
t:='0000000000';
}
insert(a,t,3); insert(a,t,6); insert(a,t,9); insert(a,t,12);
write(t);
end;
Begin
clrscr;
{k:=1}; i:=10;
repeat
writeln('Saisir le numéro de téléphone : ');
readln(s);
s := BalayageIn(s);
{
length(balayageIn(s)):=length(s);
}
writeln(s);
Test(s);
until length(s)=i;
Format_Points(s,'.');
readln;
End. |
Partager