yes actually we have to print a,b,c..z instead of nos , so for that i have stored nos in character array so only characters will be printed not nos
On Sat, Aug 11, 2012 at 2:18 AM, yq Zhang <zhangyunq...@gmail.com> wrote: > @shiv, your code is correct go compute the base 26 number. However, this > question is not base 26 number obviously. > > > > On Wed, Aug 8, 2012 at 4:46 AM, shiv narayan <narayan.shiv...@gmail.com>wrote: > >> this is similar to conversion of no in base 26.( where digits are >> a,b,c,d...z) just think it like decimal to binary conversion here base is >> instead 26. >> >> char Carr[26]={a,b,c...z} >> i=0; >> int arr[]; >> do >> { >> arrr[i++]=n%26; >> n/=2; >> } >> while(n) ; >> for(int i=n-1;i>=0;i--) >> cout<<Carr[a[i]]; >> >> correct me if i am wrong. >> On Wednesday, 8 August 2012 12:56:56 UTC+5:30, ashgoel wrote: >>> >>> Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab, >>> aac.... aax, aaz, aba, abc... (Its same as excel column names). Given an >>> integer (n), generate n-th string from the above sequence. >>> >>> Best Regards >>> Ashish Goel >>> "Think positive and find fuel in failure" >>> +919985813081 >>> +919966006652 >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/algogeeks/-/Z3kYiTZi_F8J. >> >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Shiv Narayan Sharma Jt. Secretary CSI-DTU +919971228389 www.jugadengg.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.