Advertisement
a53

adobe

a53
Feb 26th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define NMAX 100001
  3. using namespace std;
  4. ifstream fin("adobe.in");
  5. char sir[NMAX];
  6. int n;
  7.  
  8. bool searchanagram(int position)
  9. {
  10. int i, j;
  11. char c,s[]="bdaeo", aux[6];
  12. for(i=0; i<5; ++i)
  13. aux[i]=sir[position+i];
  14. aux[5]='\0';
  15. for(j=0; j<5; ++j)
  16. {
  17. c=s[j];
  18. for(i=0; i<5 && c!=aux[i];++i)
  19. ;
  20. if(i<5)
  21. aux[i]='.';
  22. else
  23. {
  24. if(j<2)
  25. c='+';
  26. else
  27. c='-';
  28. for(i=0; i<5 && c!=aux[i];++i)
  29. ;
  30. if(i<5)
  31. aux[i]='.';
  32. else
  33. {
  34. c='*';
  35. for (i=0; i<5 && c!=aux[i];++i)
  36. ;
  37. if(i<5)
  38. aux[i]='.';
  39. else
  40. return false;
  41. }
  42. }
  43. }
  44. return true;
  45. }
  46. int main()
  47. {
  48. cin>>sir;
  49. for(n=0;sir[n]!='\0';++n)
  50. if(sir[n]>='A' && sir[n]<='Z')
  51. sir[n]+=32;
  52. int nr=0;
  53. for(int i=0;i<n-4;++i)
  54. nr+=searchanagram(i);
  55. cout<<nr;
  56. return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement