//----------------------------------------------------------------------- // File: prob.cc // Description: Assemble fragmented message // Author: Chau-Wen Tseng (tseng@cs.umd.edu) //----------------------------------------------------------------------- #include #include #include // Uncomment the following lines if using APCS classes // #include "apvector.h" // #include "apmatrix.h" // #include "apstack.h" // #include "apqueue.h" #include "apstring.cpp" //----------------------------------------------------------------------- // main //----------------------------------------------------------------------- int main() { const int FRAGSIZE = 12; const int MAXFRAG = 100; apstring frag[MAXFRAG], result; int numFrag, i; // read in all fragments cin >> numFrag; for (i = 0; i < numFrag; i++) { cin >> frag[i]; if (frag[i].length() != FRAGSIZE) { cout << "ERROR, illegal fragment size " << frag[i] << endl; } } //////////////////// BEGIN your solution ///////////////////////////// result = frag[0]; //////////////////// END your solution ///////////////////////////// cout << result << endl; return 0; }