Quoting this answer on SO
getchar_unlocked is deprecated in Windows because it is thread unsafe version of getchar().
getchar_unlocked which has less overheads as compared to scanf or cin is not a standard feature of c or c++ , you can always use getchar() for that purposes here .
or you can write a function getchar_unlocked() to return the values of getchar() for on machine testing purposes if you are bound to use it in your online question .