18 条题解

  • 2
    @ 2023-11-17 18:30:09
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a, b, c;//定义三个整数a,b,c
        cin >> a >> b >> c;//输入这三个整数。
        cout << (a + b) * (c - b);//输出表达式的值
        return 0;
    }
    
    • 1
      @ 2023-8-20 19:07:58

      挥肠简单👀️

      定义变量,输入,输出就好

      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a , b , c;
          cin >> a >> b >> c;
          cout << (a + b) * (c - b);
          return 0;
      }
      
      • 0
        @ 2024-4-4 13:44:31
        using namespace std;
        int main()
        {
            int a, b, c;//定义三个整数a,b,c
            cin >> a >> b >> c;//输入这三个整数。
            cout << (a + b) * (c - b);//输出表达式的值
            return 0;
        }
        
        
        • 0
          @ 2024-3-11 16:48:41

          #include <iostream> using namespace std; int main() { //(a+b)(c-b) int a,b,c; cin>>a>>b>>c; cout<<(a+b)(c-b); return 0; }

          • 0
            @ 2024-1-26 13:45:30
            #include <iostream>
            using namespace std;
            int main()
            {
                int a, b, c;
                cin >> a >> b >> c;
                cout<<(a + b) * (c - b);
                return 0;
            }
            
            • 0
              @ 2023-9-2 20:20:13

              #include <iostream> using namespace std; int main() { int a,b,c; cin >> a >> b >> c; cout << (a+b)*(c-b); return 0; }

              • 0
                @ 2023-8-27 17:14:29

                十分简单

                *以下代码均已AC

                C++的题解很多人都发过了,发个python的吧 常规写法是这样的:

                s = input().split() # 以空格来分隔输入
                s = map(int, s) # 列表s里是str,所以要转化成int
                s = list(s) # python3.x的map函数返回的是迭代器,这里要转化成列表
                a = s[0]
                b = s[1]
                c = s[2]
                print((a + b) * (c - b))
                

                可以看到题目很简单,但细节很多,包括很多数据类型之间的转换. 当然,可以少定义三个变量:

                s = input().split() 
                s = map(int, s)
                s = list(s)
                print((s[0] + s[1]) * (s[2] - s[1]))
                

                同理,我们可以把整个代码压缩到两行:

                s = list(map(int,(input().split())))
                print((s[0]+s[1])*(s[2]-s[1]))
                

                如果使用lambda + map,甚至可以压缩到一行:

                print(next(map(lambda s: (s[0] + s[1]) * (s[2]-s[1]), [list(map(int, input().split()))])))
                

                当然,不建议这样做,这会大大降低代码的可读性,平时自己写一下就好

                • 0
                  @ 2023-8-19 18:58:51
                  #include <bits/stdc++.h>//好习惯
                  using namespace std;
                  int main()
                  {
                      int a, b, c;
                      cin >> a >> b >> c;
                      cout << (a + b) * (c - b);
                      return 0;//好习惯
                  }
                  
                  • 0
                    @ 2023-8-16 7:57:46
                    #include <iostream>
                    using namespace std;
                    int main(){
                    int a , b , c;
                    cin >> a >> b >> c;
                    cout << (a + b) * (c - b);
                    return 0;
                    }
                    
                    
                    
                    • 0
                      @ 2023-8-9 11:37:21

                      很简单,注意格式和细节就行了❤️

                      #include<iostream> using namespace std; int main() { int a,b,c; cin >> a >> b >> c; cout << (a + b)*(c-b); return 0; }

                      
                      
                      • 0
                        @ 2023-7-31 14:37:37

                        `简单!上代码!`` #include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a + b) * (c - b); return 0; }

                        
                        
                        • 0
                          @ 2023-6-9 10:33:02

                          谁不会我笑他一整年

                          #include<bits/stdc++.h>
                          using namespace std;
                          int main(){   
                              short a,b,c;
                              cin>>a>>b>>c;
                              cout<<(a+b)*(c-b);
                              return 0;
                          }
                          
                          </span>
                          • 0
                            @ 2023-2-24 12:39:37

                            #include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a + b) * (c - b); return 0; }

                            • 0
                              @ 2023-1-12 12:36:03
                              #include <iostream>
                              using namespace std;
                              int main()
                              {
                                  int a, b, c;
                                  cin >> a >> b >> c;
                                  cout << (a + b) * (c - b);
                                  return 0;
                              }
                              
                              • 0
                                @ 2022-11-20 15:03:49

                                这题有点像那道用来熟悉OJ环境的题,那话不多说,上代码!

                                #include <iostream>
                                using namespace std;
                                int main()
                                {
                                    int a, b, c;
                                    cin >> a >> b >> c;
                                    cout << (a + b) * (c - b);
                                    return 0;
                                }
                                

                                放心,Accepted 过的~

                                • -2
                                  @ 2023-9-11 21:03:50

                                  #include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<(a+b)*(c-b); return 0; } 已AC,放心食用

                                  • -5
                                    @ 2023-2-6 15:23:45

                                    写题解请注意

                                    鼓励大家写题解,但注意题解格式。

                                    题解一定要有思路解析或代码注释,能否让别人理解你的思路

                                    也是你的能力的检验,不要只放无意义的代码给大家复制,那就失去了做题的初心。

                                    给代码两端加上这个会舒服一些

                                    ```cpp

                                    你的代码

                                    ```

                                    </span>

                                    这个点在键盘的左上角tab上面那个键,注意切换输入法

                                    #include<iostream>
                                    using namespace std;
                                    int main()
                                    {
                                        int n;
                                        cin>>n;//这是一个注释
                                        return 0;
                                    }
                                    

                                    请注意严禁抄袭题解,写题解不要只放代码,需加上你的思路或代码注释。

                                    抄袭题解一经发现直接取消成绩。

                                    题解被删除的可能

                                    1. 代码不符合格式规范
                                    2. 没有思路讲解或者没有注释,
                                    3. 无意义的题解

                                    大家携手共同维护一个良好的编程环境,如果一经发现,多次作乱。可能会被管理员拉黑,请注意,一旦拉黑即失去登陆资格。

                                    • -6
                                      @ 2023-2-26 15:35:03

                                      写题解请注意

                                      鼓励大家写题解,但注意题解格式。

                                      题解一定要有思路解析或代码注释,能否让别人理解你的思路

                                      也是你的能力的检验,不要只放无意义的代码给大家复制,那就失去了做题的初心。

                                      给代码两端加上这个会舒服一些

                                      ```cpp

                                      你的代码

                                      ```

                                      </span>

                                      这个点在键盘的左上角tab上面那个键,注意切换输入法

                                      #include<iostream>
                                      using namespace std;
                                      int main()
                                      {
                                          int n;
                                          cin>>n;//这是一个注释
                                          return 0;
                                      }
                                      

                                      请注意严禁抄袭题解,写题解不要只放代码,需加上你的思路或代码注释。

                                      抄袭题解一经发现直接取消成绩。

                                      题解被删除的可能

                                      1. 代码不符合格式规范
                                      2. 没有思路讲解或者没有注释,
                                      3. 无意义的题解

                                      大家携手共同维护一个良好的编程环境,如果一经发现,多次作乱。可能会被管理员拉黑,请注意,一旦拉黑即失去登陆资格。

                                      • 1

                                      信息

                                      ID
                                      2033
                                      时间
                                      1000ms
                                      内存
                                      256MiB
                                      难度
                                      2
                                      标签
                                      递交数
                                      790
                                      已通过
                                      479
                                      上传者