Advertisement
ProToTN

SimplifiedVersionEx

Mar 2nd, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.01 KB | None | 0 0
  1. uses wincrt;
  2. var CH:String[50];
  3.  
  4.  
  5. Function Check(CH:String[50]):Boolean;
  6. Var i:Byte;
  7. Begin
  8.   i:=1;
  9.   While (CH[i] in ['A'..'Z','a'..'z']) do
  10.   Begin
  11.     i:=i+1;
  12.   End;
  13.   Check:=(length(CH)<50) and (length(CH)=i);
  14. End;
  15.  
  16.  
  17. Procedure Saisie(Var CH:String[50]);
  18. Begin
  19.   Repeat
  20.     writeln('CH: ');
  21.     readln(CH);
  22.   Until Check(CH);
  23. End;
  24.  
  25.  
  26. Procedure Affiche(CH:String[50]);
  27. Var RES,RES1,RES2,RES3:String[50];
  28.     i:byte;
  29. Begin
  30.   RES:='';
  31.   RES1:='';
  32.   RES2:='';
  33.   RES3:='';
  34.   For i:=1 to length(CH) do
  35.   Begin
  36.     if not(CH[i] in ['A','E','I','I','U','Y']) and (CH[i] in ['A'..'Z']) then
  37.     Begin
  38.       RES:=RES+CH[i];
  39.     End
  40.     Else if (CH[i] in ['A'..'Z']) then
  41.     Begin
  42.       RES1:=RES1+CH[i];
  43.     End
  44.     Else if not(CH[i] in ['a','e','i','o','u','y']) and (CH[i] in ['a'..'z']) then
  45.     Begin
  46.       RES2:=RES2+CH[i];
  47.     End
  48.     Else if (CH[i] in ['a'..'z']) then
  49.     Begin
  50.       RES3:=RES3+CH[i];
  51.     End;
  52.   End;
  53.   RES:=RES+RES1+RES2+RES3;
  54.   writeln('Res: ',CH);
  55. End;
  56.  
  57.  
  58. Begin
  59.   Saisie(CH);
  60.   Affiche(CH);
  61. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement