diff --git a/CPP/attributeparser.cpp b/CPP/attributeparser.cpp new file mode 100644 index 0000000..51b89ca --- /dev/null +++ b/CPP/attributeparser.cpp @@ -0,0 +1,76 @@ +#include +#include +#include +#include +#include +#include +using namespace std; +int main() +{ + int n, q,i; + cin>>n>>q; + string temp; + vector hrml; + vector quer; + cin.ignore(); + for(i=0;i m; + vector tag; + for(i=0;i' ),temp.end()); + if(temp.substr(0,2)==">ch>>t1>>p1>>ch>>v1; + string temp1=""; + if(tag.size()>0) + { + temp1=*tag.rbegin(); + temp1=temp1+"."+t1; + } + else + { + temp1=t1; + } + tag.push_back(temp1); + m[*tag.rbegin()+"~"+p1]=v1; + while(ss) + { + ss>>p1>>ch>>v1; + m[*tag.rbegin()+"~"+p1]=v1; + } + } + } + for(i=0;i