Skip to content

Instantly share code, notes, and snippets.

@SeqviriouM
Created September 29, 2013 08:30
Show Gist options
  • Save SeqviriouM/6750448 to your computer and use it in GitHub Desktop.
Save SeqviriouM/6750448 to your computer and use it in GitHub Desktop.
#include <string>
#include <iostream>
using namespace std;
int main()
{
string str,str1,str2;
int count,i,j,k,pos;
count=0;
i=0;
getline(cin,str);
while(!str.empty())
{
pos=str.find(":");
pos++;
if (str[pos] == ':')
{
count++;
}
else if ((str[pos] == ' ') && (str[pos+1] == ':'))
{
count++;
}
else
{
while (str[pos] != ':')
{
if ((str[pos] == '*') || (str[pos] == '!'))
{
i++;
}
pos++;
}
if (i == 0)
{
count++;
}
}
i=0;
getline(cin,str);
}
cout<<count<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment