Scan to read input with R

Hi all,
I use R but I don’t manage to use correctly the scan function to read the input. It always says “read 0 items”… I think I also tried readline but it was the same.
Can someone help? (even if there are few R-users over there)
I am sure my code is correct except it can’t read the input, so that I have a time limit exceed or a wrong answer…
Thank you!