One of my friend asked me to write a program that encode a message and make it difficult to understand, kind or secret message.
Message: Hi I am Sunil
First of all there should not be any white space, so our message now looks like “HiIamSunil”. Now we have to make a rectangle form of the message where rows can not be greater than columns.
HiIa
mSun
il
Now the encoded message is “Hmi iSl Iu an”. There should be a white space between every word.
Other examples:
Input: Chillout
Output: Clu hlt io
Input: Good day Sunil
Output: Gdu oan oyi dSl
Here is my solution:
string str = “Good day Sunil”.Replace(” “, “”);
int len = str.Length;
double result = Math.Sqrt(len);
double numCol = Math.Ceiling(result);
double numRow = Math.Floor(result);
int colNo = (int)numCol;
char[] arr = str.ToCharArray();
string encodeMsg = string.Empty;
string temp;
for (int i = 0; i < colNo; ++i)
{
temp = string.Empty;
for (int j = i; j < len; )
{
temp += arr[j];
j += colNo;
}
encodeMsg += temp + ” “;
}
Console.WriteLine(encodeMsg);
Console.ReadLine();
What’s Going down i’m new to this, I stumbled upon this I have
found It positively helpful and it has aided me out loads.
I’m hoping to give a contribution & assist other customers like its helped me. Good job.
LikeLike
Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. Seo Plugin
LikeLike
There are some fascinating deadlines on this article but I don’t know if I see all of them center to heart. There is some validity but I will take maintain opinion till I look into it further. Good article , thanks and we want extra! Added to FeedBurner as effectively
LikeLike
It’s nearly impossible to find experienced people in this particular subject, however, you sound like you know what you’re talking
about! Thanks
LikeLike
It is not my first time to visit this site, i
am visiting this website dailly and get pleasant data from here
every day.
LikeLike
Hi there, I read your blog on a regular basis.
Your story-telling style is witty, keep doing what you’re doing!
LikeLike
I was suggested this web site by my cousin. I am not sure whether this post is written by him as nobody else know
such detailed about my trouble. You’re incredible! Thanks!
LikeLike
Hi, this weekend is pleasant for me, because this occasion
i am reading this fantastic educational paragraph here at
my residence.
LikeLike
Hello There. I found your blog using msn.
This is an extremely well written article. I will make sure to bookmark it and
return to read more of your useful information.
Thanks for the post. I will certainly comeback.
LikeLike
You made some really good points there. I looked on the net for additional information about the issue and found most people will go along with your views on this web site.
LikeLike
Greate post. Keep writing such kind of info on your page.
Im really impressed by your blog.
Hi there, You’ve performed a great job. I’ll definitely digg it and in
my view recommend to my friends. I am confident they’ll be benefited from this site.
LikeLike
Hi there! Would you mind if I share your blog with my myspace group?
There’s a lot of folks that I think would really appreciate your content. Please let me know. Cheers
LikeLike
Fascinating blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple adjustements would
really make my blog jump out. Please let me know where you
got your theme. Thanks
LikeLike
Thanks on your marvelous posting! I certainly enjoyed reading it, you happen to be a great author.
I will be sure to bookmark your blog and will eventually come back from now on.
I want to encourage you to continue your great posts, have a nice holiday weekend!
LikeLike
Sweet blog! I found it while browsing on Yahoo News.
Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Cheers
LikeLike
You need to be a part of a contest for one of the most useful websites on the
net. I most certainly will highly recommend this
site!
LikeLike
Greetings! Very helpful advice in this particular post!
It’s the little changes that will make the biggest changes. Thanks a lot for sharing!
LikeLike
Your means of telling everything in this post is truly good, all be
capable of effortlessly understand it, Thanks a lot.
LikeLike
We’re a group of volunteers and opening a new scheme in our community. Your website offered us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.
LikeLike
An outstanding share! I’ve just forwarded this onto a colleague who has been conducting a little homework on this. And he in fact bought me breakfast simply because I found it for him… lol. So allow me to reword this…. Thank YOU for the meal!! But yeah, thanks for spending time to talk about this matter here on your internet site.
LikeLike
Thanks for writing Secret Message Encoding in C# | Code World
Technology. I’m certainly certainly motivated that some one might piece of writing something like this. The item reminds myself a little of duke sweatpants that is another history totally. Enjoy a wonderful day!
LikeLike
I simply desired to point out I honestly understand a person’s writing skills. It’s good
to read someone whom provides a comprehension of syntax plus punctuation on-line.
I will tell many others about Secret Message Encoding in C# |
Code World Technology. Cheers!
LikeLike
Exceptional post however , I was wanting to know if you could write a litte more on this topic?
I’d be very grateful if you could elaborate a little bit more. Bless you!
LikeLike
I got what you intend,bookmarked , very nice website .
LikeLike
Fine way of explaining, and nice paragraph to get data regarding
my presentation topic, which i am going to convey in college.
LikeLike
Because the admin of this web page is working, no doubt very shortly it will be famous, due to its feature contents.
LikeLike
You are so cool! I don’t suppose I’ve read something like that before.
So nice to find another person with a few genuine thoughts on this subject.
Seriously.. thank you for starting this up. This website is
something that is required on the internet, someone with a
little originality!
LikeLike
Good day! This post could not be written any better! Reading through this
post reminds me of my good old room mate! He always kept talking about this.
I will forward this write-up to him. Pretty sure he will have a good read.
Many thanks for sharing!
LikeLike
Truly no matter if someone doesn’t be aware of then its up to
other users that they will assist, so here it takes place.
LikeLike
Wonderful blog post.Thanx pertaining to making this kind of useful article plus enlightening us with all your ideas.I am hoping you are going to continue to keep this specific good work in future as well.
LikeLike