Last active
December 24, 2015 05:19
-
-
Save spellancer/6750112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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