64 条题解

  • 0
    @ 2023-8-15 8:42:30
    #include <iostream>//我才不会告诉你有万能头这个东西
    using namespace std;
    int main()
    {
    int n;//定义一个变量n(abcdefg也可以)
    cin >> n;//输入n
    cout << (n / 10) + (n % 10);//输出结果,n/10得出十位数,n%10得出个位数
    return 0;
    }
    
    
    
    • 0
      @ 2023-8-14 21:37:10

      #include <bits/stdc++.h> { int n; cin>>n; cout<<n%10+n/10;//数字除以10的商即为这个数十位上的数,数字除以10的余即为这个数个位上的数 }

      • 0
        @ 2023-8-14 21:36:38

        #include <bits/stdc++.h> { int n; cin>>n; cout<<n%10+n/10;//数字除以10的商即为这个数十位上的数,数字除以10的余即为这个数个位上的数,可以自己试验,非常简单 }

        • 0
          @ 2023-8-9 14:27:41
          #include <iostream>
          using namespace std;
          int main()
          {
              int n;
              cin>>n;
              c0ut<<(n/10)+(n%10);//n/10相当于是n的十位数,n%10相当于是n的个位数;
              return o;
          }
          
          • 0
            @ 2023-8-8 20:35:50

            1

            #include <iostream>
            using namespace std;
            int main()
            {
                int a;
                cin>>a;
                cout<<a%10+a/10;
            }
            

            2

            #include <iostream>
            using namespace std;
            int main()
            {
                 int a;
                cout<<6;
            }
            
            • 0
              @ 2023-8-8 19:47:25
              #include<iostream>//虽然有万能头文件,但是一身反骨的我,怎么会用呢?
              using namespace std;
              char n[2]; //读入2个数就阔以了呢
              int main()
              {
                  cin>>n[0]>>n[1];
                  cout<<n[0]-'0'+n[1]-'0'; // 根据ASCLL码的性质把读入字符转换成数字然后相加
                  return 0;//哈哈,养成好习惯O(∩_∩)O
              }
              

              哈哈哈,一身反骨的我又又又又来写题解了,刚来的时候拉坤的要死[虽然现在也没什么长进],连换个头像都不会l_l 但是写题解真的好有成就感,就感觉自己在帮忙,还被夸奖/奖励了一样 新手可以试试写一些简单的题解,难度不会太大,好上手,越到后面,自己会的,理解的知识就越来越多 好了,拜拜,下一题见(^_^)

              • 0
                @ 2023-8-7 20:29:46
                #include<iostream>
                using namespace std;
                int main()
                {
                    int a=0,b=0,x;
                    cin>>x;
                    a=x/10;
                    b=x%10;
                    cout<<a+b;
                    return 0;
                }
                
                • 0
                  @ 2023-8-7 10:16:24
                  #include <bits/stdc++.h>
                      using namespace std;
                      int main()
                      {
                          int n,a,b;
                          cin >> n;
                          a=n/10;
                          b=n%10;
                          cout << a+b;
                          return 0;
                      }
                  
                  • 0
                    @ 2023-8-4 16:46:33

                    比前面几题简单了亿点👀️image

                    • 0
                      @ 2023-8-3 19:21:14
                      #include <iostream>
                      using namespace std;
                      int main()
                      {
                          int a,b,n;
                          a=n/10;
                          b=n%10;
                          cout<<a+b;
                          return 0;
                      }
                      
                      • 0
                        @ 2023-8-1 18:34:07

                        #include <iostream> using namespace std; int main() { int y; cin>>y; cout<<(y/10)+(y%10); // 不需要 return 0; }

                        
                        
                        • 0
                          @ 2023-8-1 16:04:19
                          #include <iostream>
                          using namespace std;
                          int main()
                          {
                              int n;
                              cin >> n;
                              cout << n%10 + n/10;
                              return 0;
                          }
                          
                          • 0
                            @ 2023-8-1 13:28:24
                            #include <iostream>
                            using namespace std;
                            int main()
                            {
                                int n,x,y;
                                cin>>n;
                                x=n/10;
                                y=n%10;
                                cout<<x+y;
                                return 0;
                            }
                            
                            • 0
                              @ 2023-8-1 13:27:47

                              简单明了,上代码! #include <iostream> using namespace std; int main() { int n,x,y; cin>>n; x=n/10; y=n%10; cout<<x+y; return 0; }

                              • 0
                                @ 2023-7-23 22:35:38
                                #include <bits/stdc++.h>
                                using namespace std;
                                
                                int main()
                                {
                                    int a , b;
                                    cin >> a;
                                    b = a % 10 + a / 10; //提取输入的数的个位和十位 并求和
                                    cout << b;
                                    return 0;
                                }
                                
                                • 0
                                  @ 2023-7-18 21:01:10

                                  n/10表示n的十位,由于整除后保留整数部分,用商再乘10得到一个整十数,再用n减去它就可以得到个位

                                  #include <iostream>
                                  using namespace std;
                                  int main()
                                  {
                                     int n;
                                     cin >> n;
                                     cout << (n/10)+n-(n/10*10);
                                     return 0;
                                  }
                                  

                                  (创新方式,虽然有点复杂😄 )

                                  • 0
                                    @ 2023-5-3 13:22:07

                                    #include<iostream> using namespace std; int main() { int n; cin>>n; cout<<n/10+n%10; return 0; }

                                    • 0
                                      @ 2023-3-28 21:38:37
                                      #include<bits/stdc++.h>
                                      using namespace std;
                                      int main()
                                      {
                                          int x;
                                          cin>>x;
                                          cout<<x/10+x%10;
                                          return 0;
                                      }
                                      
                                      • 0
                                        @ 2023-2-25 15:37:36
                                        #include <iostream>
                                        using namespace std;
                                        int main()
                                        {
                                            int n;
                                            cin >> n;
                                            cout << n/10 + n%10;//分别读取十位数字与个位数字
                                        }
                                        
                                        
                                        • 0
                                          @ 2023-2-7 14:06:23
                                          #include <bits/stdc++.h>
                                          using namespace std;
                                          int main()
                                          {
                                              int a,n,x=0;
                                              cin >> n ;
                                              x=n/10;
                                              a=n%10;
                                              cout<<x+a;
                                              return 0;
                                          }
                                          

                                          【入门】求一个两位数的个位和十位的和

                                          信息

                                          ID
                                          602
                                          时间
                                          1000ms
                                          内存
                                          64MiB
                                          难度
                                          3
                                          标签
                                          递交数
                                          5322
                                          已通过
                                          3045
                                          上传者