2 条题解

  • 3
    @ 2023-10-2 21:00:38

    谁有我快

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        cout<<"B"<<endl<<"M"<<endl<<"X";
        return 0;
    }
    
    • 1
      @ 2023-1-25 12:11:43

      #970. 【入门】回文字母

      遍历26个字母,判断它的ASCII码

      因为26个字母的ASCII码都是两位数,所以判断ASCII码的个位与十位是否相同即可

      两位数求十位方法:数字/10 两位数求个位方法:数字%10

      ACcode:

      #include <iostream>
      #include <cstdio>
      #include <string>
      
      using namespace std;
      
      int main()
      {
          for (char c = 'A'; c <= 'Z'; c++)//这里有个小技巧,可以直接把循环变量定义成char类型
          {
              int x = c;
              if (x / 10 == x % 10)
                  cout << c << endl;
          }
          return 0;
      }
      
      • 1

      信息

      ID
      970
      时间
      1000ms
      内存
      64MiB
      难度
      3
      标签
      递交数
      135
      已通过
      70
      上传者