杭电2027

#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;

int
main(int argc, char *argv[])
{

    int
A,E,I,O,U,n,len;
    char
str[100];
    cin>>n;
    getchar();
    while
(n--)
    {

      A=0;
      E=0;
      I=0;
      O=0;
      U=0;
      gets(str);
      len=strlen(str);
      for
(int i=0;i<len;i++)
      {

        if
(str[i]=='a')
          A++;
        if
(str[i]=='e')
          E++;
        if
(str[i]=='i')
          I++;
        if
(str[i]=='o')
          O++;
        if
(str[i]=='u')
          U++;
      }

      printf("a:%d\n",A);
      printf("e:%d\n",E);
      printf("i:%d\n",I);
      printf("o:%d\n",O);
      printf("u:%d\n",U);
      if
(n!=0)
        cout<<endl;  
    }

    //system("PAUSE");
    return EXIT_SUCCESS;
}

 

此题已经AC过去了,不知为什么,只看到了成功的代码,我提交了五次,结果只把我成功的记录了,是系统的问题吗?我还想看看和错误的代码有什么区别呢?

posted @ 2012-07-30 10:48  Marshalkk  阅读(333)  评论(0编辑  收藏  举报