Skip to content

Instantly share code, notes, and snippets.

@spellancer
Last active December 24, 2015 05:19
Show Gist options
  • Select an option

  • Save spellancer/6750112 to your computer and use it in GitHub Desktop.

Select an option

Save spellancer/6750112 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
using namespace std;
int main ()
{
char buff[300];
unsigned int res=0;
bool k=false,k2=false;
ifstream fin;
ofstream fout;
fin.open("input.txt");
while (fin.getline(buff,300)!=NULL)
{
for (int i=0;i<strlen(buff);i++)
{
if (buff[i]==':' && !k)
{
k=true;
if (buff[i+1]!='*' && buff[i+1]!='!') k2=true;
}
}
if (k2) res+=1;
k2=false;
k=false;
}
fin.close();
fout.open("output.txt");
fout << res;
fout.close();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment