Misspelling is an art form that students seem to excel at. Write a
program that removes the th character from an input string.
Input Specification
The first line of input contains a single integer
which is the number of datasets that follow.
Each dataset consists of a single line of input containing , a space,
and a string made up of uppercase letters and spaces only.
will be
less than or equal to the length of the string. The length of the string
is guaranteed to be less than or equal to 80.
Output Specification
For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, and the misspelled string. The misspelled string is the input string with the indicated character deleted.
Sample Input
4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON
Sample Output
1 MISPELL
2 ROGRAMMING
3 CONTES
4 BALOON
Comments
Can anyone see why my code is wrong?
consider spaces
Good challenge. I only need over 60 submissions.
I've tested my code and it seems to work just fine, but I keep failing tests 9 and 10, why is this? I tried handling cases where M is 0 and it didn't change. Is M negative in some cases?
I faced the same issue but @charliezhao06's comment opened my eyes lol
Did you consider if the string has spaces in it?
Massive brain.