zoukankan      html  css  js  c++  java
  • hdu2027

    http://acm.hdu.edu.cn/showproblem.php?pid=2027

     1 #include<iostream>
     2 #include<stdio.h>
     3 #include<math.h>
     4 #include<stdlib.h>
     5 #include<string.h>
     6 #include<algorithm>
     7 using namespace std;
     8 
     9 int main()
    10 {
    11     //freopen("in.txt","r",stdin);
    12     int n;
    13     char s[110];
    14     scanf("%d",&n);
    15     getchar();
    16     while(n--)
    17     {
    18         gets(s);
    19         int len=strlen(s);
    20         int a=0,e=0,i=0,o=0,u=0;
    21         for(int j=0;j<len;j++)
    22         {
    23             if(s[j]=='a')
    24             a++;
    25             else if(s[j]=='e')
    26             e++;
    27             else if(s[j]=='i')
    28             i++;
    29             else if(s[j]=='o')
    30             o++;
    31             else if(s[j]=='u')
    32             u++;
    33         }
    34         printf("a:%d
    ",a);
    35         printf("e:%d
    ",e);
    36         printf("i:%d
    ",i);
    37         printf("o:%d
    ",o);
    38         printf("u:%d
    ",u);
    39         if(n!=0)
    40         printf("
    ");
    41     }
    42     return 0;
    43 }
  • 相关阅读:
    Lucas 定理
    C语言II博客作业04
    C语言II博客作业03
    C语言II博客作业02
    C语言II博客作业01
    学期总结
    First project
    C语言I博客作业08
    C语言I博客作业07
    C语言I博客作业06
  • 原文地址:https://www.cnblogs.com/xuesen1995/p/4907269.html
Copyright © 2011-2022 走看看