#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n;
char str[N];
int a[N];

int main() {
    scanf("%s",str+1);
    n=strlen(str+1);
    for(int i=1;i<=n;i++) {
        if(str[i]=='a' || str[i]=='e' || str[i]=='i'
           || str[i]=='o' || str[i]=='u' || str[i]=='y')
            a[i]=a[i-1]+1;
        else a[i]=a[i-1];
    }
    double ans = 0;
    double tmp = 0;
    for(int i=1;i<=n;i++) {
        if(i==1) tmp=a[n];
        else tmp+=a[n-i+1]-a[i-1];
        ans += tmp/i;
    }
    printf("%.8lf",ans/n/(n+1)*2);
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案