Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. ifstream f("date.in");
  4.  
  5. int vocale(char s[])
  6. {
  7. int c=0,i;
  8. for(i=0;i<strlen(s);++i)
  9. if(strchr("AEIOUaeiou",s[i])) c++;
  10. return c;
  11. }
  12.  
  13. int consoane(char s[])
  14. {
  15. int c=0,i;
  16. for(i=0;i<strlen(s);++i)
  17. if(strchr("AEIOUaeiou",s[i])==NULL) c++;
  18. return c;
  19. }
  20.  
  21. int main()
  22. {
  23. char s[256],cuv[150][256],m[256];
  24. int i,j,n=0;
  25. cin.get(s,256);
  26. char *p=strtok(s," ");
  27. while(p)
  28. {
  29. ++n;strcpy(cuv[n],p);
  30. p=strtok(NULL," ");
  31. }
  32.  
  33.  
  34. for(i=1;i<=n;i++)
  35. for(j=i+1;j<=n;j++)
  36. if(strcmp(cuv[i],cuv[j])>0) swap(cuv[i],cuv[j]);
  37.  
  38.  
  39. for(i=1;i<=n;++i)
  40. cout<<cuv[i]<<endl;
  41.  
  42. strcpy(m,cuv[1]);
  43. for(i=2;i<=n;++i)
  44. if(vocale(cuv[i])>vocale(m)) strcpy(m,cuv[i]);
  45. cout<<m<<endl;
  46.  
  47. int nr=0;
  48. for(i=1;i<=n;i++)
  49. if(vocale(cuv[i])>consoane(cuv[i])) nr++;
  50. cout<<nr;
  51. cout<<endl;
  52.  
  53. for(i=0;i<strlen(s);i++)
  54. {
  55. for(j=i;j<strlen(s);j++)
  56. cout<<cuv[n][j];
  57. cout<<endl;
  58. }
  59.  
  60.  
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement