Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- using namespace std;
- int a[100][100];
- int main()
- {
- char s[255],voc[]="aeiou",*p;
- int i,x,y,m=0,j;
- ifstream f("perechivocale1.in");
- ofstream g("perechivocale1.out");
- while(f.get(s,sizeof(s)))
- {
- f.get();
- for(i=0;i<strlen(s)-1;i++)
- if(strchr(voc,s[i])!=0 && strchr(voc,s[i+1])!=0)
- {
- p=strchr(voc,s[i]);
- x=p-voc;
- p=strchr(voc,s[i+1]);
- y=p-voc;
- a[x][y]++;
- if(a[x][y]>m)
- m=a[x][y];
- }
- }
- if(m==0)
- g<<"NU";
- else
- for(i=0;i<5;i++)
- for(j=0;j<5;j++)
- if(a[i][j]==m)
- g<<voc[i]<<voc[j]<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement