You are not logged in. Please login at www.codechef.com to post your questions!

×

please help me in this simple problem

i am not able to understand what is the mistake i am doing in this program?http://ideone.com/8lWeoX

asked 15 Mar '15, 19:52

rahulsup's gravatar image

1★rahulsup
251212
accept rate: 0%

link not working

(15 Mar '15, 19:55) shivam2174★

link is broken

link

answered 15 Mar '15, 23:18

pallesai's gravatar image

4★pallesai
176830
accept rate: 17%

include<iostream>

using namespace std; int main() { int t,i,J; char a[100]; cin>>t; for(i=0;i<t;i++) { int count=0; gets(a); for(int j=0;a[j]=='\0';i++) { if((a[j]=='A')||(a[j]=='D')||(a[j]=='O')||(a[j]=='P')||(a[j]=='Q'||)(a[j]=='R')) { count=count+1; } if(a[j]=='B') { count=count+2; } } cout<<count; } return 0; }

(17 Mar '15, 20:30) rahulsup1★

link is broken

link

answered 15 Mar '15, 23:18

pallesai's gravatar image

4★pallesai
176830
accept rate: 17%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,345
×1,911
×1,477

question asked: 15 Mar '15, 19:52

question was seen: 875 times

last updated: 17 Mar '15, 20:30