zoukankan      html  css  js  c++  java
  • 杭电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过去了,不知为什么,只看到了成功的代码,我提交了五次,结果只把我成功的记录了,是系统的问题吗?我还想看看和错误的代码有什么区别呢?

  • 相关阅读:
    阿里--面经 搜集
    阿里一面经验总结
    System对象
    JDBC-oracle(登陆)
    博客静态页面
    设计模式(1)---Factory Pattern
    软件设计师备考经验(含新旧版本对比)
    第九课,ROS仿真1
    参数服务器相关的问题
    3.空域图像处理的洪荒之力
  • 原文地址:https://www.cnblogs.com/gkfeng/p/2614854.html
Copyright © 2011-2022 走看看