Skip to content

Instantly share code, notes, and snippets.

@shemul
Created November 8, 2014 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shemul/8cc5f0a1466668ff118d to your computer and use it in GitHub Desktop.
Save shemul/8cc5f0a1466668ff118d to your computer and use it in GitHub Desktop.
Solving != Coding [ACM]
#include<iostream>
using namespace std ;
int main ()
{
const char *str = "BA BA BA BABANANA\
BA BA BA BABANANA\
BANANA NA AHH, POTATO NA AH AH BANANA AH AH\
TO GA LI NO PO TAH TO NI GAH NI BAH LO BAH NI KAH NO JI GAH BA BA BA BABANANA.\
YO PLANO HU LA PA NO NO TU MA BANANA LIKE A NUPI TALAMOO\
BANANA BA BA BABANANA BA BA BA BABANANA\
POTATO HO HOOOOOO\
TO GA LI NO PO TAH TO NI GAH NI BAH LO BAH NI KAH NO JI\
GAH BA BA BA BABANANAAAAAAAAA\
DHISYAAAAAA";
int counter = 0 ;
int i = 0 ;
while(str[i]!='\0')
{
if(str[i]=='A')
{
counter++;
}
i++;
}
cout << counter ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment