0
Hello.Can you help me?
Enter two lines, compare them(which are long) Is there any other way to do this? https://code.sololearn.com/cytIMNAk0g16/?ref=app Input: array ; array massive Output : the second word is longer than the first
4 ответов
+ 3
Two things to be noted in your code and it works fine .
First is taking user input , Use getline(cin,str); instead of depricated old gets () ,if you are not inputting more than 1 word its better to use cin<< , otherwise use getline .
Second Know how to compare string length in cpp .
+ 2
I don't know what the problem is on line 10 and 12.
but on the line 18, you need to use brackets since you're printing out more than one line in the if and else statements.
+ 1
Алиаскар Куватов Check this , Now it's perfect :
https://code.sololearn.com/cRqYME8dKmrD/?ref=app
0
Thank you very much