Created
July 13, 2014 16:52
-
-
Save satellitex/2255348897726acbfd30 to your computer and use it in GitHub Desktop.
This file contains 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<bits/stdc++.h> | |
using namespace std; | |
int N; | |
char buf[65536]; | |
int main(){ | |
while( fgets(buf,sizeof(buf),stdin) != '\0'){ | |
string S = buf; | |
string search1 = "<div class=\"qtext\">"; | |
int id; | |
if( (id = S.find( search1 )) != (int)string::npos ) { | |
string sub = S.substr( id + search1.size() ); | |
string q = sub.substr(0, sub.find("</div>")); | |
cout << "question::" << endl; | |
cout << q << endl; | |
string search2 ="The correct answer is: "; | |
while( fgets(buf,sizeof(buf),stdin) != '\0' ) { | |
S = buf; | |
if( (id = S.find( search2 )) != (int)string::npos) { | |
sub = S.substr( id + search2.size() ); | |
string ans = sub.substr(0, sub.find("</div>")); | |
cout << "answer 1" << endl; | |
cout << ans << endl << endl; | |
break; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment