6 条题解

  • 2
    @ 2023-11-15 19:08:06

    我真聪明,用字符串

    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        string s;
        cin >> s;
        cout << s[0] << endl << s[1] << endl << s[2] << endl << s[3] << endl << s[4] << endl << s[5] << endl;
        return 0;
    }
    
    • 1
      @ 2024-3-2 9:52:58

      最简单就是用char了,代码简单思路也简单

      #include <iostream>
      using namespace std;
      int main()
      {
          char a;
          for (int i=1;i<=6;i++)
          {
              cin >> a;
              cout << a << endl;
          }
          return 0;
      }
      

      已AC

      • 1
        @ 2023-8-24 11:11:42

        过辣!(脑残人士的欢呼)

            string n;
            cin>>n;
            for (int i=0;i<6;i++)
            {
                cout<<n[i]<<endl;
            }
        
        • 0
          @ 2024-2-3 10:31:46

          为何要用数学模拟(int),而不用字符串(string)呢? 为何要用字符串(string),而不用字符(char)呢? char! 我的神! 思路:循环六次,每次输入一个字符a,再将其输出。 AC代码:

          #include<iostream>
          using namespace std;
          char a;
          int main(){
              for(int i=1;i<=6;i++){
                  cin>>a;
                  cout<<a<<endl;
              }
              return 0;
          }
          
          • 0
            @ 2023-5-31 17:42:39
            #include <bits/stdc++.h>
            using namespace std;
            string n;
            int main()
            {
                cin >> n;
                for (int i = 0; i <= 5; i++)
                {
                    cout << n[i] << endl;
                }
                return 0;
            }
            

            其实可以不用循环

            • 0
              @ 2023-1-19 11:39:10
              #include <iostream>//hetao3097453
              using namespace std;
              int main()
              {
                  int n;
                  cin >> n;
                  int a = n % 10;
                  int b = n % 100 / 10;
                  int c = n % 1000 / 100;
                  int d = n % 10000 / 1000;
                  int e = n % 100000 / 10000;
                  int f = n % 1000000 / 100000;
                  cout << f << endl << e << endl << d << endl << c << endl << b << endl << a;
                  return 0;
              }
              
              • 1

              【入门】求六位整数的各个位

              信息

              ID
              608
              时间
              1000ms
              内存
              64MiB
              难度
              2
              标签
              递交数
              202
              已通过
              131
              上传者