0

Can someone tell me the reason why can't it work? Thanks a lot!

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

9th Apr 2018, 4:07 AM
ssiswent
ssiswent - avatar
2 ответов
+ 4
In the code, change 'cin.get(ch)' to 'ch = cin.get()', as the former call is for strings while you read a single character per iteration. Also, it seems cin.get() does not trigger the input prompt in the code playground, and so to provide input, you need to add the following line outside main : #define x cin>> This line makes the playground assume that the program tried to call cin and you will be able to read input via cin.get().
9th Apr 2018, 4:30 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
Thank you so much!!
9th Apr 2018, 8:09 AM
ssiswent
ssiswent - avatar