Program Generation;
Var
cle,init,RIB: string;
//***************************
Function verif(ch:String): Boolean;
Var
i: integer;
b: boolean;
Begin
i := 0;
Repeat
i := i+1;
If ch[i] In ['A'..'Z'] Then
b := true
Else
b := false;
Until (i=length(ch)) Or (Not(b));
verif := b;
End;
//***************************
Procedure saisir(Var init,RIB:String);
Begin
Repeat
writeln('init=');
readln(init);
Until (Length(init)=2) And (verif(init));
Repeat
writeln('RIB:');
readln(RIB);
Until length(RIB) In [10..30];
End;
//***************************
Function cle_IBAN(init:String): string;
Var
ch,ch1: string;
d,i,e: integer;
Begin
ch := '';
For i:=1 To length(init) Do
Begin
str(ord(init[i])-55,ch1);
ch := ch+ch1;
End;
ch := ch+'00';
val(ch,d,e);
d := 98-(d Mod 97);
If d<10 Then d := d*10;
str(d,ch);
cle_IBAN := ch;
End;
//***************************
Begin
saisir(init,RIB);
cle := cle_IBAN(init);
writeln('l''IBAN correspondant est : ',init+cle+RIB);
End.
Inscription à :
Publier les commentaires (Atom)