4 条题解

  • 2
    @ 2023-12-24 18:54:19
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        char ch;
        cin>>ch;
        if(ch=='z')
            cout<<'a';
        else if(ch=='Z')
            cout<<'A';
        else 
            printf("%c",ch+1);
        return 0;
    }
    

    已AC,放心食用

    • 1
      @ 2023-8-11 8:40:13
      #include <bits/stdc++.h>
      using namespace std;
      int main(){
          char c,ans;
          cin>>c;
          c>='a'&&c<='z'?ans='a'+((c-'a'+1)%26):ans='A'+((c-'A'+1)%26);
          cout<<ans<<endl;
          return 0;
      }
      
      • 1
        @ 2023-7-17 17:07:07

        二话不说上代码!

        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
            char x;
            cin>>x;
            x=x+1;
            if(x=='{') cout<<"a";
            else if(x=='[') cout<<"A";
            else cout<<x;
            return 0;//已AC,放心用。
        }
        
        • 1
          @ 2023-1-25 11:46:17

          #996.求下一个字母

          ascii码大家都知道吧,这里就不多讲了

          附上ACcode

          #include <iostream>
          #include <cstdio>
          
          using namespace std;
          
          int main()
          {
              char c;
              cin >> c;
              if (c == 'Z')//题中原话:如果是'z'请输出'a',如果是'Z'请输出'A',所以要特判,不然就会输出其他字符
              {
                  cout << 'A';
                  return 0;
              }
              if (c == 'z')
              {
                  cout << 'a';
                  return 0;
              }
              cout << char(c + 1);//直接c+1是不行的,这样会输出数字,应再转回char
              return 0;
          }
          
          • 1

          信息

          ID
          966
          时间
          1000ms
          内存
          128MiB
          难度
          4
          标签
          递交数
          138
          已通过
          65
          上传者