#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
const std::string data_text =
R"(>MCHU - Calmodulin - Human, rabbit, bovine, rat, and chicken
ADQLTEEQIAEFKEAFSLFDKDGDGTITTKELGTVMRSLGQNPTEAELQDMINEVDADGNGTID
FPEFLTMMARKMKDTDSEEEIREAFRVFDKDGNGYISAAELRHVMTNLGEKLTDEEVDEMIREA
DIDGDGQVNYEEFVQMMTAK*
>gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]
LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV
EWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLG
LLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVIL
GLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGX
IENY
)";
std::istringstream in(data_text);
int main()
{
std::string line;
std::vector<std::string> sequences;
bool in_sequence = false;
while (getline(in, line))
{
if (in_sequence)
{
if (line.size() && line.front() != '>')
sequences.back() += line;
else if (line.front() == '>')
in_sequence = false;
}
else if (line.size() && line.front() != '>')
{
sequences.push_back(line);
in_sequence = true;
}
}
for (auto seq : sequences)
std::cout << seq << "\n\n";
}
I2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHNzdHJlYW0+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDx2ZWN0b3I+Cgpjb25zdCBzdGQ6OnN0cmluZyBkYXRhX3RleHQgPQpSIig+TUNIVSAtIENhbG1vZHVsaW4gLSBIdW1hbiwgcmFiYml0LCBib3ZpbmUsIHJhdCwgYW5kIGNoaWNrZW4KQURRTFRFRVFJQUVGS0VBRlNMRkRLREdER1RJVFRLRUxHVFZNUlN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