#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> words;
string mips;
cout << "Enter Mips: ";
getline(cin, mips);
cout<< mips;
string temp;
char c;
for(int i = 0; i<mips.size(); i++)
{
if(((mips[i] != ',')||(mips[i] != ' ') || (mips[i] != '(')||(mips[i] != ')')))
{
temp+= mips[i];
}
else if(((mips[i] = ',')||(mips[i] = ' ')) && !temp.empty())
{
words.push_back(temp);
temp.clear();
}
else if((mips[i] = '(')||(mips[i] = ')'))
{
temp+=mips[i];
words.push_back(temp);
temp.clear();
}
}
for(int i = 0; i < words.size();i++)
{
cout << words[i] << endl;
}
cout << "poop" <<endl;
return(0);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3RyaW5nPgoKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCgl2ZWN0b3I8c3RyaW5nPiB3b3JkczsKCXN0cmluZyBtaXBzOwoJY291dCA8PCAiRW50ZXIgTWlwczogICI7CiAgICBnZXRsaW5lKGNpbiwgbWlwcyk7CgogICAgY291dDw8IG1pcHM7CglzdHJpbmcgdGVtcDsKCWNoYXIgYzsKCQoJZm9yKGludCBpID0gMDsgaTxtaXBzLnNpemUoKTsgaSsrKQoJewoJCWlmKCgobWlwc1tpXSAhPSAnLCcpfHwobWlwc1tpXSAhPSAnICcpIHx8IChtaXBzW2ldICE9ICcoJyl8fChtaXBzW2ldICE9ICcpJykpKQoJCXsKCQkgICAgdGVtcCs9IG1pcHNbaV07CgkJfQoJCWVsc2UgaWYoKChtaXBzW2ldID0gJywnKXx8KG1pcHNbaV0gPSAnICcpKSAmJiAhdGVtcC5lbXB0eSgpKQoJCXsKCQkgICAgd29yZHMucHVzaF9iYWNrKHRlbXApOwoJCSAgICB0ZW1wLmNsZWFyKCk7CgkJfQoJCWVsc2UgaWYoKG1pcHNbaV0gPSAnKCcpfHwobWlwc1tpXSA9ICcpJykpCgkJewoJCSAgICB0ZW1wKz1taXBzW2ldOwoJCSAgICB3b3Jkcy5wdXNoX2JhY2sodGVtcCk7CgkJICAgIHRlbXAuY2xlYXIoKTsKCQl9CgkJCgl9CgoJCglmb3IoaW50IGkgPSAwOyBpIDwgd29yZHMuc2l6ZSgpO2krKykKCXsKCQljb3V0IDw8IHdvcmRzW2ldIDw8IGVuZGw7Cgl9CgkKCWNvdXQgPDwgInBvb3AiIDw8ZW5kbDsKcmV0dXJuKDApOwp9