Anonymous
then the output without space ab with space a b
S.
Isn’t it what you need?
Anonymous
I also just started c++.dont scare me😅😅🤣🤣
Anonymous
What’s the problem
help me to debug with this sir
Anonymous
I also just started c++.dont scare me😅😅🤣🤣
my teacher tried to scared me 😆😆😆
S.
😅 But I don’t see any problem with this code ( except for coding style and some typos
Anonymous
S.
show us the error
Anonymous
Maybe some error with compiler
Anonymous
Ohhh come on somebody gonna help or not?
Anonymous
I can't show you the error right now because I'm on ttavel
S.
We’re trying to help
Anonymous
*travel
Anonymous
If you can't show us error.how could we help,
Anonymous
?*
Anonymous
I did not bring my laptop
Anonymous
i remember that symbol3=" "; is error
S.
😑 So you figure out the problem by yourself
S.
congrats
S.
should be symbol3 = ' ';
Anonymous
but how?
Anonymous
should be symbol3 = ' ';
really i already try that but did not work
S.
symbol3 is only a char
S.
So you can’t assign a literal c-style string to it
Anonymous
yup
Anonymous
is it using string or what?
S.
cout can accept many types of variables
Anonymous
You mean cout?
symbol3=' ';
S.
symbol3 is a char
klimi
Welcome
Heenim
Heenim
can anybody help me with this?
Heenim
the error shown is "Illegal line end in string literal"
John
No
Dima
That’s not even cxx
Heenim
yeah.. it's java
S.
Your " do not match
Anonymous
int main() { vector<string> v; string x; int n; cin>>n; for(int i=0;i<n;i++) { cin>>x; v.push_back(x); } for(int i=0;i<n;i++) { x=v[i]; replace(x.begin(),x.end(),'a','0'); replace(x.begin(),x.end(),'e','1'); replace(x.begin(),x.end(),'i','2'); replace(x.begin(),x.end(),'o','3'); replace(x.begin(),x.end(),'u','4'); }
Anonymous
Why any string is not convert to number
Anonymous
As I want
Heenim
Ohh yeah
Anonymous
What do you mean?
I want to convert aeiot to 01234
Heenim
I Googled it but the answer is different
Anonymous
*aeiou
Heenim
The problem is just a typo
Anonymous
Code should give me 01234 but it gives same as I input aeiou
Mat
The problem is just a typo
You even have colours to avoid them. Be careful next time and use off topic group for Java
S.
Code should give me 01234 but it gives same as I input aeiou
Where do you output the result, think carefully
Anonymous
I have share only certain part of my code
Anonymous
int main() { vector<string> v; string x; int n; cin>>n; for(int i=0;i<n;i++) { cin>>x; v.push_back(x); } for(int i=0;i<n;i++) { x=v[i]; replace(x.begin(),x.end(),'a','0'); replace(x.begin(),x.end(),'e','1'); replace(x.begin(),x.end(),'i','2'); replace(x.begin(),x.end(),'o','3'); replace(x.begin(),x.end(),'u','4'); } for(int i=0;i<n;i++) { x=v[i]; for(int j=0;j<x.size();j++) { cout<<x[j]; } cout<<endl;
Mat
I have share only certain part of my code
Share all of it using pastebin or similar service
Heenim
You even have colours to avoid them. Be careful next time and use off topic group for Java
Yeah.. I don't have java group.. can you share to me one?
Anonymous
I mean if my Input is 3 aeiou u o Then o/p should be 01234 4 3
S.
He means, that’s a copy?
S.
If you just copy a string to x and modify x, then nothing is modified in v[i]
Mat
I mean if my Input is 3 aeiou u o Then o/p should be 01234 4 3
I get it. But when you assign v[i] to x you have to be sure you're not copying it
Anonymous
Mean
Anonymous
Buddy will ellobrate and how to correct it
Anonymous
Ok I got it I have changed in x then I have to copy that in vector again and delete previous one right
Anonymous
?
Mat
That's a solution, yeah
S.
Why not use a reference
S.
Like for(int i = 0; i<n; i++) { string& x = v[i]; replace(x.begin(),x.end(),'a','0'); replace(x.begin(),x.end(),'e','1'); replace(x.begin(),x.end(),'i','2'); replace(x.begin(),x.end(),'o','3'); replace(x.begin(),x.end(),'u','4'); }
Anonymous
I haven't think this for😅
Anonymous
How to reduce time complexity of this
Anonymous
https://ideone.com/FsiopM
Anonymous
Any idea?!!!
Anonymous
Anonymous
?