Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream f("date.in");
- int vocale(char s[])
- {
- int c=0,i;
- for(i=0;i<strlen(s);++i)
- if(strchr("AEIOUaeiou",s[i])) c++;
- return c;
- }
- int consoane(char s[])
- {
- int c=0,i;
- for(i=0;i<strlen(s);++i)
- if(strchr("AEIOUaeiou",s[i])==NULL) c++;
- return c;
- }
- int main()
- {
- char s[256],cuv[150][256],m[256];
- int i,j,n=0;
- cin.get(s,256);
- char *p=strtok(s," ");
- while(p)
- {
- ++n;strcpy(cuv[n],p);
- p=strtok(NULL," ");
- }
- for(i=1;i<=n;i++)
- for(j=i+1;j<=n;j++)
- if(strcmp(cuv[i],cuv[j])>0) swap(cuv[i],cuv[j]);
- for(i=1;i<=n;++i)
- cout<<cuv[i]<<endl;
- strcpy(m,cuv[1]);
- for(i=2;i<=n;++i)
- if(vocale(cuv[i])>vocale(m)) strcpy(m,cuv[i]);
- cout<<m<<endl;
- int nr=0;
- for(i=1;i<=n;i++)
- if(vocale(cuv[i])>consoane(cuv[i])) nr++;
- cout<<nr;
- cout<<endl;
- for(i=0;i<strlen(s);i++)
- {
- for(j=i;j<strlen(s);j++)
- cout<<cuv[n][j];
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement