Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- using namespace std;
- char s[256],cuv[200];
- int k=0,poz,fin;
- int a;
- int main()
- {
- ifstream f("test.html");
- while(f.getline(s,256))
- {
- k=0;
- cuv[0]=0;
- for(int i=0;i<=strlen(s)-1;i++)
- {
- if(s[i]=='<' && s[i+1]!='/')
- {
- i++;
- while(s[i]!='>' && s[i])
- {
- cuv[k++]=s[i++];
- }
- cuv[k]=0;
- if(s[i]=='>')
- {
- if(strstr(cuv,"img") && strstr(cuv,"src"))
- {
- a=strstr(cuv,"src")-cuv+5;
- while(cuv[a]!='"')
- {
- cout << cuv[a];
- a++;
- }
- cout << endl;
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement