9 条题解

  • 1
    @ 2025-6-8 17:06:49

    又双要上代码了。。。

    1.内置函数

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

    2.强制转换

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

    祝编程顺利!!

    • 1
      @ 2025-4-1 20:04:23
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n;cin>>n;
          cout<<char(n);
          return 0;
      }
      
      

      强制类型转换

      • 1
        @ 2025-2-12 20:47:15

        强转

        #include<bits/stdc++.h>
        #define yy return 0;
        using namespace std;
        int main(){
            int a;cin>>a;cout<<char(a);
            yy
        }
        • 0
          @ 2025-10-26 10:34:13

          #include <bits/stdc++.h> using namespace std;

          int main() { int c; cin >> c; cout << static_cast(c) << endl; return 0; }

          • 0
            @ 2025-9-21 20:47:03
            #include <iostream>
            using namespace std;
            int main(){
            	char a;
            	cin>>a;
            	cout<<int(a);
            	return 0;
            }
            
            
            • 0
              @ 2025-9-17 21:28:16
              #include<iostream>
              using namespace std;
              int main(){
                  int a;
                  cin>>a;
                  std::cout << (char)a;
              
              }
              
              
              • 0
                @ 2025-6-12 18:27:22
                #include<bits/stdc++.h>
                using namespace std;
                int main()
                {
                    int n;cin>>n;
                    cout<<(char)(n);
                    return 0;
                }
                

                强转好东西

                • 0
                  @ 2024-11-29 22:00:39

                  luogu-B2018题解

                  luogu-B2017双倍经验

                  主要题意

                  输入一个数字,输出它相对的 ASCII 码转化的字符。

                  解题思路

                  输入数字后,直接强制转换为char类型输出。

                  上代码!

                  #include<bits/stdc++.h>
                  using namespace std;
                  int a;
                  int main()
                  {
                      cin>>a;
                      cout<<(char)a;
                      return 0;
                  }
                  
                  
                  • -5
                    @ 2024-12-5 12:23:33

                    呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃鹅鹅鹅鹅鹅鹅饿DSVVVVVVVVVVVVVFFFFFFFFFFFFFFFFFWWWWWWWWWWWWWWWWWWWWWWWWWWWWWYEUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU8T

                    • 1

                    信息

                    ID
                    4468
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    1
                    标签
                    (无)
                    递交数
                    282
                    已通过
                    216
                    上传者