vowel count

Back to General discussions forum

Bright Mensah Kofi     2016-01-10 17:39:27

im doing the task id 20(vowel task); when i post my result, the page says its wrong however, when i cross check where it was wrong, and i count that line myself, my answer it correct but the page has an increment of 1. somebody help please! did i read the task wrongly or something?

Quandray     2016-01-10 20:58:51
User avatar

Hi,

Here's a few things that need looking at, but there may be more.

Variable str has length 100, but variable i just keeps growing and will go beyond 100.

The first line of input contains the number of test cases, but you don't use this. As the first line has no vowels, your output starts with a 0.

Line 12 uses the variable ch but it hasn't been assigned a value.

I'm not sure you can rely on the last line ending with a \n.

You never do anything with the ch you read in line 26 and this is the first character of later lines.

Please login and solve 5 problems to be able to post at forum