5 条题解

  • 3

    #include<bits/stdc++.h> using namespace std; int main() { char a; cin>>a; cout<<char(int(a)-32); return 0; } 这个比较简单

    • 2
      @ 2024-12-16 22:19:18

      #include<bits/stdc++.h> using namespace std; int main(){ char a; cin>>a; cout<<char(int(a-32)); return 0; }

      • 2
        @ 2024-11-10 15:16:04
        #include<cstdio>
        main() {char a;scanf("%c",&a),printf("%c",char(a - 32));}
        
        • 1
          @ 2025-2-4 19:54:50

          要知道 aA,对应的 ASCII 码值为 97976565

          故有以下代码:

          #include <bits/stdc++.h>
          #include <cctype>
          #include <string>
          #define endl '\n'
          
          using namespace std;
          
          typedef long long ll;
          
          int main() {
              char s;
              cin >> s;
              s -= 32;
              cout << s << endl;
              return 0;
          }
          
          • 1
            @ 2024-11-25 20:10:52

            luogu-P5704题解

            主要题意

            输入一个小写字母,输出它的大写。

            解题思路

            在 ASCALL 码中(下图),大写字母与小写字母的距离为 3232 ,因此得出以下代码。

            上代码!

            #include <bits/stdc++.h>
            using namespace std;
            int main()
            {
            	char a,b;
            	cin>>a,cout<<char(a-32);
            }
            
            • 1

            信息

            ID
            9726
            时间
            1000ms
            内存
            125MiB
            难度
            1
            标签
            (无)
            递交数
            70
            已通过
            47
            上传者