Re: [algogeeks] help nedded

2011-09-24 Thread Kunal Yadav
2nd #include #include using namespace std; int main() { string s; cin>>s; int i=0,count=1; vector no; vector c; while(s[i]!='\0') { if(s[i]==s[i+1]) count++; else { c.push_back(s[i]); no.push_back(count);

Re: [algogeeks] help nedded

2011-09-24 Thread Kunal Yadav
for 1st #include #include using namespace std; int main() { char c; string s; int n; vector ans; cin>>s; int i=0; while(s[i]!='\0') { c=s[i]; n=s[i+1]-'0'; while(n--) ans.push_back(c); i+=2; } for(i=0;i wrote: > for

Re: [algogeeks] help nedded

2011-09-22 Thread Dheeraj Sharma
for 1st #include #include #include using namespace std; int main() { char str[100]; cin>>str; int len=strlen(str); int i=1; while(i wrote: > for 2nd one > #include > #include > using namespace std; > int main() > { > char str[100]; > cin>>str; > > char ch=str[0]; >

Re: [algogeeks] help nedded

2011-09-22 Thread Dheeraj Sharma
for 2nd one #include #include using namespace std; int main() { char str[100]; cin>>str; char ch=str[0]; int count=0,i=0; while(str[i]) { if(str[i]==ch) count++; else { cout i

[algogeeks] help nedded

2011-09-21 Thread rahul sharma
i found a question of ms earlier but know i not able to find it.plz post link or thread i/p::a3b2c4: o/p:aaabb i/p:aaabbc o/p:a3b2c1 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeek