Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Crypt

a guest Apr 10th, 2020 158 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program ex;
  2. uses wincrt;
  3.  
  4. Var
  5. ph:string;
  6.  
  7. function verif(ch:string):boolean;
  8. var
  9. i:integer;
  10. Begin
  11. i := 1;
  12. while (upcase(ch[i]) in ['A'..'Z']) or (ch[i] = ' ') Do
  13. Begin
  14. i:=i+1;
  15. end;
  16. verif:=(i>=length(ch));
  17. end;
  18.  
  19. procedure saisie(var ph:string);
  20. Begin
  21. repeat
  22. writeln('saisir une phrase  à crypter : ');
  23. readln(ph);
  24. until verif(ph);
  25. end;
  26.  
  27.  
  28. procedure crypt(ch:string);
  29. Var
  30. chC:string;
  31. r,i:integer;
  32. Begin
  33. chC:='';
  34. r:=1;
  35. for i := 1 to length(ch) Do
  36. Begin
  37. if ch[i] = ' ' Then
  38. Begin
  39. r:=r+1;
  40. chC:=chC+' ';
  41. end
  42. Else if upcase(ch[i]) = 'Z' Then
  43. Begin
  44. chC := chC + chr(ord(ch[i])-25);
  45. end
  46. else
  47. Begin
  48. chC := chC + chr(ord(ch[i])+r);
  49. end;
  50. end;
  51. writeln(chC);
  52. end;
  53.  
  54. Begin
  55. saisie(ph);
  56. crypt(ph);
  57. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top