Advertisement
Guest User

29

a guest
Jan 19th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. int vocale(char s[])
  7. {
  8.     int l=0;
  9.     for(int i=0;i<strlen(s);i++)
  10.         if(strchr("aeiouAEIOU",s[i])!=0)
  11.             l++;
  12.     return l;
  13. }
  14.  
  15. int main()
  16. {
  17.     ifstream fin("date.in");
  18.     ofstream fout("date.out");
  19.     char s1[201],s2[201];
  20.     int maxx=0,m;
  21.     fin.get(s1,200);
  22.     fin.get();
  23.     strcpy(s2,s1);
  24.     char *p=strtok(s1," ");
  25.     while(p)
  26.     {
  27.         m=vocale(p);
  28.         if(m>maxx)
  29.             maxx=m;
  30.         p=strtok(NULL," ");
  31.     }
  32.     p=strtok(s2," ");
  33.     while(p)
  34.     {
  35.         m=vocale(p);
  36.         if(m==maxx)
  37.             fout<<p<<" ";
  38.         p=strtok(NULL," ");
  39.     }
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement