Jump to content
Sega

[Decriptare3] C++ Sursa

Recommended Posts

Am facut un programel in C++ dupa challenge-ul lui @Sulea si anume ACESTA

CRIPTARE

Exemplu: PALD

1) P e consoana : P+4=T

2) A e vocala : A+4=E; E+10=O; se insereaza in string, si tot ce se afla dupa O se incrementeaza cu 1;

avem: TEOme

3)M e consoana : M+4=Q;

4)E e vocala : E+4=I; I+10=S;

Rezultat final: TEOQIS

DECRIPTARE

Avem nevoie de un vector in care sa pastram pozitiile pt. decrementare.

Luam vectorul vec[333];

Exemplu: TEOQIS

1)T-4=P; P e cons deci ramane asa, avem p

2)E-4=A; A e vocala => stergem urmatoarea litera si ramane paQIS si pastram pozitia curenta in i=0 vec=2; i++;

3)Q-4=M; avem: pamIS

4)I-4=E; E e voc stergem urmatoarea litera si ramane PAME

la final in vec=lungimea noului string adica 4

Si acum de la vec[0] la vec[1]: adica de la 2 la 4 decrementam cu 1; paME => paLD

Sper ca am fost explicit. Daca aveti o alta idee postati aici va rog.

Sursa DOWNLOAD:

MediaFire

2Shared

GirlShare

Program DOWNLOAD:

MediaFire

2Shared

GirlShare

Edited by Sega
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...