2 条题解

  • 2
    @ 2023-12-25 21:10:18
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        string str;
        getline(cin,str);
        for(int i=0;i<str.size();i++)
        {
            if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
            {
                printf("%c",str[i]-32);
    			continue;
            }
            else if(str[i]<='Z'&&str[i]>='A')
            {
    			if(str[i]!='A'&&str[i]!='E'&&str[i]!='I'&&str[i]!='O'&&str[i]!='U')
                printf("%c",str[i]+32);
    			else printf("%c",str[i]);
    			continue;
            }
            printf("%c",str[i]);
        }
        
        return 0;
    }
    

    已AC,放心食用

    • 0
      @ 2023-7-27 18:10:15
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          string s;
          char c,d;
          getline(cin,s);
          for (int i = 0;i < s.size();i++)
          {
              c = s[i];
              if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
              {
                  d = c - 32;
                  cout << d;
                  continue;
              }
              if (c >= 'B' && c <= 'Z' && c != 'E' && c != 'I' && c != 'O' && c != 'U')
              {
                  d = c + 32;
                  cout << d;
                  continue;
              }
              cout << c;
          }
      }
      
      • 1

      【入门】元音字母转大写辅音字母转小写

      信息

      ID
      978
      时间
      1000ms
      内存
      64MiB
      难度
      7
      标签
      递交数
      72
      已通过
      17
      上传者