Try configuring your compiler to show you all possible warnings, as that may help you catch subtle bugs. For example, when I compiled your code, I received:apcastelein wrote:I'm having an issue with my code. It works for the sample input but I get RE when submitting
Code: Select all
p.cpp: In function ‘int main()’:
p.cpp:64:17: warning: format ‘%s’ expects a matching ‘char*’ argument [-Wformat=]
scanf("%s");
^
Code: Select all
scanf("%*s");