The error is, that you are declaring char array of length 100 only. If S=100, then theres no space for ‘\0’ character, and this causes you to get WA since your loop condition depends on it.
1 Like
The error is, that you are declaring char array of length 100 only. If S=100, then theres no space for ‘\0’ character, and this causes you to get WA since your loop condition depends on it.