#include <iostream> #include <string> using namespace std;
int main() { string s; string str = ""; cin >> s; char pre; for(int i = 0; i < s.length(); i++) { if(47 < s[i] and s[i] < 58){ while((s[i]-48) > 1) { str += pre; s[i]--; } } if(96 < s[i] and s[i] < 123) { str += s[i]; pre = s[i]; } //cout << str << endl; } cout << str; return 0; } On Wed, Jul 25, 2012 at 6:46 AM, Sathish babu <satbrucei...@gmail.com>wrote: > can anyone provide the code to convert ab1cd3 to abcddd > **~Sathish Babu~** > > > > On Tue, Jul 24, 2012 at 11:39 PM, Mind Boggler <min.b...@gmail.com> wrote: > >> Traditional decryption problem >> Convert a3b2c5 into aaabbccccc >> Can anyone Put forward an algo for the test case: a3b1c3d1 >> Thanx >> >> -- >> 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. >> >> > -- > 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. > -- With regards, Manish kumar untwal Indian Institute of Information Technology Allahabad (2009-2013 batch) -- 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.