Guest User

Untitled

a guest
Mar 13th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. int main(){
  6.     const char * nazwaPliku = "1.html";
  7.     ifstream strona(nazwaPliku);
  8.     if (strona.is_open()){
  9.         string foo;
  10.         string szukana = "class=\"wpis\"";
  11.         int wystapien = 0;
  12.         while (strona >> foo){
  13.             if(foo.find(szukana) != string::npos){
  14.                 wystapien++;
  15.             }
  16.         }
  17.         if(wystapien==1){
  18.             remove(nazwaPliku);
  19.         }
  20.     }
  21.     strona.close();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment