Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. char s[256],cuv[200];
  7. int k=0,poz,fin;
  8. int a;
  9.  
  10.  
  11. int main()
  12. {
  13. ifstream f("test.html");
  14.  
  15. while(f.getline(s,256))
  16. {
  17. k=0;
  18. cuv[0]=0;
  19.  
  20. for(int i=0;i<=strlen(s)-1;i++)
  21. {
  22. if(s[i]=='<' && s[i+1]!='/')
  23. {
  24. i++;
  25.  
  26. while(s[i]!='>' && s[i])
  27. {
  28. cuv[k++]=s[i++];
  29. }
  30.  
  31. cuv[k]=0;
  32.  
  33. if(s[i]=='>')
  34. {
  35. if(strstr(cuv,"img") && strstr(cuv,"src"))
  36. {
  37. a=strstr(cuv,"src")-cuv+5;
  38.  
  39. while(cuv[a]!='"')
  40. {
  41. cout << cuv[a];
  42. a++;
  43. }
  44. cout << endl;
  45. }
  46. }
  47.  
  48. }
  49.  
  50. }
  51. }
  52.  
  53.  
  54.  
  55.  
  56. return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement