Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. typedef long long ll;
  3. using namespace std;
  4.  
  5. int main(){
  6.     string s;
  7.     bool f = false;
  8.     bool add = false;
  9.     int cnt = 0;
  10.     string tmp;
  11.     vector<string> ans;
  12.     while(getline(cin, s)){
  13.         if (f){
  14.             if (s == "<tr>") {
  15.                 if (add && tmp.size() > 0){
  16.                     ans.push_back(tmp);
  17.                 }
  18.                 cnt = 0;
  19.                 tmp = s;
  20.                 add = false;
  21.             }
  22.             else cnt++;
  23.             if (cnt == 2 && s.substr(s.find(','), 4) == ", 10") add = true;
  24.             tmp += s;
  25.         }
  26.         if (!f) ans.push_back(s);
  27.         if (s == "<tbody>") f = true;
  28.         if (s == "</tbody>") {
  29.             f = false;
  30.             ans.push_back(s);
  31.         }
  32.     }
  33.     for (string &s : ans) cout << s << '\n';
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement