Advertisement
Ghimici

vocmax

Jun 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. #include<stdio.h>
  4. #include <string.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {char text[200],c[200];
  10. int n,i,j,nr,max=0;
  11. ifstream f1("vocmax.i");
  12. ofstream f2("vocmax.o");
  13. {
  14. f1>>n;
  15. for(i=1;i<=n;i++)
  16. {
  17. f1.get(text,200);
  18. nr=0;
  19. for(j=0;j<strlen(text);j++)
  20. if(strchr("aeiou",text[i])!=NULL)
  21. nr++;
  22. if(max<nr)
  23. {
  24. max=nr;
  25. strcpy(c,text);
  26. }
  27. }
  28. f2<<c;
  29. }
  30. f2.close();
  31. f1.close();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement