Varianta 61 / Subiectul 3 / Problema 4 |
#include<fstream.h> #include<string.h> ifstream fin("text.in"); char v[]="aeiou"; int f[5][5];// f[0][0] e pt aa, f[3][4] e pt ou, etc void main() { char x,y; fin>>x; while(fin>>y) { if(strchr(v,x) && strchr(v,y)) f[strchr(v,x)-v][strchr(v,y)-v]++; x=y; } int i,j,max=0; for(i=0;i<=4;i++) for(j=0;j<=4;j++) if(f[i][j]>max) max=f[i][j]; for(i=0;i<=4;i++) for(j=0;j<=4;j++) if(f[i][j]==max) cout<<v[i]<<v[j]<<endl; } |