Programming with Passion

Make the best out of everything.

Tuesday, 13 January 2015

Cypher

Cypher

You know about cypher? They are the encrypted word that are made so that not everyone could read it. A word can be made completely nonsense. One may come up with this it is useless but it is not. 
Here is a program to convert nonsense words to useful words. 
Works for T cases.... And also it only works for lower case letter. You must try for uppercase.


#include<iostream.h>
#include<string.h>
#include<stdio.h>
void main()
{
char ch[100];
int T,  m;
cin>>T;
while(T)
{
gets(ch);
for(int i=0;i<strlen(ch);++i)
{
m=int(ch[i])+i;
if(m>122) 
m-=26;
ch[i]=char(m); 
 }
cout<<ch<<"\n";
--T;
}
}

Some e.g. You must Try with this..

  1. bkmd
  2. tdaejjptlzec
  3. qvcopt
  4. aacpax
  5. cqwmpzr
  6. gdlbnj
  7. qzxjgjj
  8. azzyyx
  9. cnbb
  10. wxqfsta

Happy Coding....

No comments:

Post a Comment