Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

holes, wrong answer.

$
0
0

include<stdio.h>

int main() { int count = 0, counter = 0; char input; scanf("%d", &count); for (; count != 0; count--) { scanf("%c", &input); while (input != '\n') { scanf("%c", &input); if (input == 'A'||input == 'D'||input == 'O'||input == 'P'||input == 'Q') counter++; else if (input == 'B') counter + 2; } printf("%d\n", counter); } return 0; } can anyone tell wats wrong wit this code. input takes in '\n' after i enter the counter value.


Viewing all articles
Browse latest Browse all 39796


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>