Page 1 of 1

is there no one who can help.no one???!!!surprised.pls help.

Posted: Mon Feb 16, 2009 11:35 pm
by shorojini
:cry: :( :oops: :roll: :cry: i am getting wrong answer in this problem.
i am giving my code here.if there is not any prob in code then there must
be some prob in my input output system.please can anyone give me any solution and
some some sample input output.pls pls pls mark me my prob.pls pls pls. #include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
while(getline(cin,s))
{
int l=s.length();

int k=0;
for(int i=0;i<l;i++){

if(s>=48 && s<=57)
k=k+s-48;

else if(s=='!')
cout<<"\n";

else{
if(s=='b') {
for(int i=0;i<k;i++)
cout<<" "; }
else{
for(int j=0;j<k;j++)
cout<<s; }
k=0;
}

if(i==l-1)
cout<<"\n";

}




}
return 0;
}