Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new way to say HAPPY BIRTHDAY #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wimanshaherath
Copy link

used cpp here

@welcome
Copy link

welcome bot commented Oct 3, 2020

Thanks for opening this pull request! 🤗
Wishing you a great Hacktoberfest 2020 🙌 🎉 ⚡️
Are you looking for more beginner-friendly issues? Check out this repo.

Hacktoberfest2020

📢 Spread the word about @vinitshahdeo/Hacktoberfest2020 repo across your social media channels to help get others involved! Give a shoutout to DEV article. Retweet this.

Open Source Love

Check out few other repos below 🚀

PortScanner
SimpleBio
Water-Monitoring-System
Map Of India

Show some ❤️

  • Consider leaving a ⭐ here.
  • Check out more beginner-friendly repos here.
  • Follow @vinitshahdeo for more updates.
  • Read my open-source journey here.

Say Hi on Twitter! 👋

Twitter Follow

PS: Please add @vinitshahdeo as a reviewer if you haven't added.

Copy link

@7smn2219 7smn2219 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use "using namespace std;" instead of using it multiple times in a code and also you can decrease the number of brackets in upper for loop.

@7smn2219
Copy link

you can use "using namespace std;" instead of using it multiple times in a code and also you can decrease the number of brackets in upper for loop.

I can do it in cpp assign this issue to me

`#include <bits/stdc++.h>
using namespace std;

string generateKey(string message,string k)
{
int x=message.size();
for(int i=0;;i++)
{
if(x==i)i=0;
if(k.size()==message.size())break;
k.push_back(k[i]);
}
return k;
}
string originalText(string encMessage,string key)
{
string orig_Text;
for(int i=0;i<encMessage.size();i++)
{
char x=(encMessage[i]-key[i]+26)%26;
x+='A';
orig_Text.push_back(x);
}
return orig_Text;
}

int main()
{
string encMess="dihwujayppvhu";
string key=generateKey(encMess,"wish");
string text=originalText(encMess,key);
cout<<text.substr(0,text.size()-8)<<' '<<text.substr(text.size()-8,text.size()-1)<<endl;
return 0;
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants