Skip to content

Instantly share code, notes, and snippets.

@jiunbae
Created October 1, 2015 15:59
Show Gist options
  • Save jiunbae/3ecca8f3057af596d24f to your computer and use it in GitHub Desktop.
Save jiunbae/3ecca8f3057af596d24f to your computer and use it in GitHub Desktop.
#include<regex>
#include<iostream>
#include<string>
using namespace std;
int main(int argc, char ** argv)
{
int test; cin >> test;
while (test--)
{
string str; cin >> str;
regex pat("[A-F]?A+F+C+$[A-F]?");
if (regex_match(str, pat))
cout << "Infected!" << endl;
else
cout << "Good" << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment