Advertisement
Guest User

dfgdgbdsf

a guest
May 25th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstring>
  4. using namespace std;
  5. int a[100][100];
  6. int main()
  7. {
  8.    char s[255],voc[]="aeiou",*p;
  9.    int i,x,y,m=0,j;
  10.    ifstream f("perechivocale1.in");
  11.    ofstream g("perechivocale1.out");
  12.    while(f.get(s,sizeof(s)))
  13.    {
  14.        f.get();
  15.        for(i=0;i<strlen(s)-1;i++)
  16.         if(strchr(voc,s[i])!=0 && strchr(voc,s[i+1])!=0)
  17.        {
  18.            p=strchr(voc,s[i]);
  19.            x=p-voc;
  20.            p=strchr(voc,s[i+1]);
  21.            y=p-voc;
  22.            a[x][y]++;
  23.            if(a[x][y]>m)
  24.             m=a[x][y];
  25.        }
  26.    }
  27.    if(m==0)
  28.     g<<"NU";
  29.    else
  30.    for(i=0;i<5;i++)
  31.     for(j=0;j<5;j++)
  32.     if(a[i][j]==m)
  33.     g<<voc[i]<<voc[j]<<" ";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement