0

HELP! I'm a beginner and i don't know what's wrong in my code. Can you help me? Thank you.

https://code.sololearn.com/c7GZWdw4ehFB/?ref=app

28th Aug 2017, 5:32 PM
Beatrice Calegari
Beatrice Calegari - avatar
6 Antworten
+ 4
you also wrote cin as Cin so there's a mistake and a char is a single character for it to work right you would need to use string
28th Aug 2017, 8:14 PM
johan beimers
johan beimers - avatar
+ 2
As I said, I've not done this yet, but by looking at the errors maybe you could try 'const char' instead of 'char' ? As for 'else without a previous if' errors try this: if ( y = x ) { cout << a; } instead of if ( y = x ) { cout << a}; Good luck :)
28th Aug 2017, 6:12 PM
Cyb3rMann
Cyb3rMann - avatar
+ 1
Hi Beatrice, I haven't done C++ yet but, are you not missing a closing bracket in your main() ? Also you're declaring ints but you are using chars, don't know if that makes a difference?
28th Aug 2017, 5:46 PM
Cyb3rMann
Cyb3rMann - avatar
+ 1
yes! that's right. i haven't fought about that. thank you very much! and...do you now if cin is ok for chars or not? thank you again
28th Aug 2017, 5:49 PM
Beatrice Calegari
Beatrice Calegari - avatar
+ 1
thank you for your help
29th Aug 2017, 5:13 AM
Beatrice Calegari
Beatrice Calegari - avatar
0
ok i changed it but it still does not work. why?
28th Aug 2017, 5:52 PM
Beatrice Calegari
Beatrice Calegari - avatar