Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

cin works but getchar() doesn't while taking a char input

$
0
0

these are my two solutions for marblegf during december long challange.

http://www.codechef.com/viewsolution/3085218

http://www.codechef.com/viewsolution/3078607

look at both the solutions. the only difference is when i used getchar_unlocked() in taking an input for character in every test case, resulted me as a wrong answer. whereas when i changed it to cin it is accepted.

can anyone pls explain why does that happen. where does getchar() result wrong in taking a character.


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>