#include #include #include using namespace std; int main () { int orgs=0, projects=0; int total_projects = 0; int beg, end; string line; string student_project_description; string s1 = "by "; while (! cin.eof() ) { getline ( cin, line ); if ( beg = line.find ( s1, 0 ) != string::npos ) { projects = 0; beg += s1.length() - 1; end = line.find ( "/", beg ); cout << setw ( 4 ) << ++orgs << ". " << line.substr ( beg, end - beg ) << endl << endl; continue; } if ( beg = line.find ( s2, 0 ) != string::npos ) { getline ( cin, student_project_description ); continue; } if ( beg = line.find ( s3, 0 ) != string::npos ) { beg += s3.length() - 1; end = line.find ( "<", beg ); cout << setw ( 8 ) << ++projects << ". " << student_project_description << endl; cout << " " << line.substr ( beg, end - beg ) << endl << endl; total_projects++; continue; } } cout << "Orgs: " << orgs << endl; cout << "Projects: " << total_projects << endl; return 0; }