Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
new
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86 #include <iostream> #include <string> #include<vector> using namespace std; int main() { string value="<?xml version=""1.0"" encoding=""UTF-8""?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><note/><body>Don't forget me this weekend!</body></note>"; vector<string> list; string w1; string a; int p1; int y = 0,z=0; int length = value.length(); string value1 = ""; for (int i = 0; i < length; i++) { if ((value[i] == '<')) { for (int y = i; y<length; y++) { if (value[y] == '>') { value1 = value1 + value[y]; list.push_back(value1); break; } value1 = value1 + value[y]; } } if ((value[i] == '>')) { for (int z = i+1; z<length; z++) { if (value[z] == '<') { //value1 = value1 + value[z]; list.push_back(value1); break; } //value1 = ""; value1 = value1 + value[z]; } } value1 = ""; } int u = list.size(); for (int o = 0; o<u; o++) { if(list.at(o)[0]=='<'&&list.at(o)[1]!='?') { int r=list.at(o).length(); for(int u=0;u<r;u++) { if(list.at(o)[u]=='<')//||list.at(o)[u]=='>')//||list.at(o)[u]=='/') { list.at(o).erase(u,1); } if(list.at(o)[u]=='/')//||list.at(o)[u]=='>')//||list.at(o)[u]=='/') { list.at(o).erase(u,1); } if(list.at(o)[u]=='>')//||list.at(o)[u]=='>')//||list.at(o)[u]=='/') { list.at(o).erase(u,1); } } } if(list.at(o)[0]=='<'&&list.at(o)[1]=='?') { int r=list.at(o).length(); for(int u=0;u<r;u++) { if(list.at(o)[u]=='<')//||list.at(o)[u]=='>')//||list.at(o)[u]=='/') { list.at(o).erase(u,1); } if(list.at(o)[u]=='?')//||list.at(o)[u]=='>')//||list.at(o)[u]=='/') { list.at(o).erase(u,1); } if(list.at(o)[u]=='>')//||list.at(o)[u]=='>')//||list.at(o)[u]=='/') { list.at(o).erase(u,1); } } } cout<<list.at(o)<<endl; } return 0; }
run
|
edit
|
history
|
help
0
ria
seh exception in constructor memory leak
10dan büyük mü küçük mü
iota_30-Seconds-of-C++
VS'15 parameter pack sfinae
make Derive final
hangman
std::function ambiguity vc++
std::current_exception makes a copy
not a parameter pack