Thursday, 7 July 2016

programming CHALLENGE [UPDATED]

guys here a text encrypting program....so the task is to make an program to decrypt that text ....here's its source code u can also download its source code @ downloadits solution will be uploaded within 15 days....you can also mail your solution @ mayank8005@gmail.com will enlist top 10 solutions mentioning your name..
for any query u can place a comment

source code....




  1. #include<iostream>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4. #include<string.h>
  5. #include<stdio.h>
  6. using namespace std;
  7. int main()
  8. {

  9. system("cls");
  10. string name;
  11. cout<<"use only lower case \n";
  12. int len,i;
  13. getline(cin,name);
  14. for(len=0;name[len];len++);
  15. for(i=0;i<len/2;i++)
  16. {
  17. if(name[i]<123&&name[i]>96)
  18. name[i]=97+(25-(name[i]-97));
  19. else if(name[i]>=48&&name[i]<=57)
  20. {
  21. if((name[i]-48)<=4)
  22. name[i]=name[i]+5;
  23. else
  24. name[i]=name[i]-5;
  25. }
  26. }
  27. for(;i<len-1;i++)
  28. {
  29. if(name[i]<=(97+13)&&name[i]>97)
  30. name[i]++;
  31. else if(name[i]>(97+13)&&name[i]<123)
  32. name[i]--;
  33. else if(name[i]>=48&&name[i]<=57)
  34. {
  35. if((name[i]-48)<=4)
  36. name[i]=name[i]+5;
  37. else
  38. name[i]=name[i]-5;
  39. }
  40. }
  41. system("cls");
  42. cout<<"gen : ";
  43. int j;
  44. for(j=0;j<len-1;j++)
  45. cout<<name[j];
  46. cout<<(int)name[j];

  47. getch();
  48. }

...................................................................................................................................................................
thank u

0 comments:

Post a Comment