111 条题解

  • 0
    @ 2023-12-30 18:01:00
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
    //"return 0" 就是结束程序
    //所以括号中可以少输入一些东西
        if (n < 10){
            cout << "A";
            return 0;
        }
    
        if (n < 20){
            cout << "B";
            return 0;
        }
    
        if (n < 40){
            cout << "C";
            return 0;
        }
    
        if (n < 50){
            cout << "D";
            return 0;
        }
    
        if (n < 80){
            cout << "E";
            return 0;
        }
    }
    
    • 0
      @ 2023-12-16 14:09:34
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a;
          cin>>a;
          if(a<10)
          {
              cout<<"A";
          }
          else if((a>=10)&(a<20))
          {
              cout<<"B";
          }
          else if((a>=20)&(a<=40))
          {
              cout<<"C";
          }
          else if((a>=40)&(a<50))
          {
              cout<<"D";
          }
          else
          {
              cout<<"E";
          }
          return 0;
      }
      
      • 0
        @ 2023-11-10 21:53:39

        三目运算符,你值得拥有

        #include <iostream>
        using namespace std;
        int main()
        {
        int n;
        cin>>n;
        cout<<(n<10?"A":n<20?"B":n<40?"C":n<50?"D":n<80?"E":"");
        return 0;
        }
        
        • 0
          @ 2023-9-10 10:51:26
          #include <iostream>
          using namespace std;
          int main()
          {
              int n;
              cin>>n;
              if(n<10)
              {
                  cout<<"A";//当货物小于十公斤
              }
              else if((n>=10)&&(n<20))
              {
                  cout<<"B";//当货物大于等于十公斤,小于二十公斤
              }
              else if((n>=20)&&(n<40))
              {
                  cout<<"C";//当货物大于等于二十公斤,小于四十公斤
              }
              else if((n>=40)&&(n<50))
              {
                  cout<<"D";//当货物大于等于四十公斤,小于五十公斤
              }
              else
              {
                  cout<<"E";//当货物大于等于五十公斤,小于八十公斤
              }
              return 0;
          }
          
          • 0
            @ 2023-8-15 15:48:36
            #include <iostream>
                using namespace std;
                int main()
                {
                    int a;
                    cin >> a;
                    if (a<10)
                    {
                        cout << "A";
                    }
                    if (a<20 and a>=10
                    {
                        cout << "B";
                    }
                    if (a<40 and a>=20)
                    {
                        cout << "C";       
                    }
                    if (a<50 and a>=40)
                    {
                        cout << "D";
                    }
                    if (a<80 and a>=50)
                    {
                        cout << "E";
                    }
                    return 0;
                }
            #
            
            • 0
              @ 2023-8-15 10:05:51
              # 今天的题目超简单,上代码!
              #include <iostream>
              using namespace std;
              int main()
              {
                  int n;
                  cin >> n;
                  if (n < 10)
                  {
                      cout << "A";
                  }
                  if (n >= 10 and n < 20)
                  {
                      cout << "B";
                  }
                  if (n >= 20 and n < 40)
                  {
                      cout << "C";
                  }
                  if (n >= 40 and n < 50)
                  {
                      cout << "D";
                  }
                  if (n >= 50 and n < 80)
                  {
                      cout << "E";
                  }
                  return 0;
              }
              
              • @ 2023-8-15 10:07:18

                AC代码,已通过,放心使用

            • 0
              @ 2023-8-15 9:29:39
              #include <iostream>
              using namespace std;
              int main()
              {
                  int a;
                  cin>>a;
                  if (a<10)
                  {
                      cout<<"A";
                  }
                  if (a>=10)
                  {
                      if (a<20)
                      {
                          cout<<"B";
                      }
                  }
                  if  (a>=20)
                  {
                      if (a<40)
                      {
                          cout<<"C";
                      }
                  }
                  if (a>=40)
                  {
                      if (a<50)
                      {
                          cout<<"D";
                      }
                  }
                  if (a>=50)
                  {
                      if (a<80)
                      {
                          cout<<"E";
                      }
                  }
                  return 0;
              }
              
              • 0
                @ 2023-8-13 16:18:29

                第五题AC代码

                这题看上去很简单,怎么还有这么多WA 废话不多说,上代码!

                #include <bits/stdc++.h>
                using namespace std;
                int main()
                {
                	int n;
                	cin >> n;//创建并输入重量
                	if (n < 10)//如果重量小于10
                	{
                		cout << "A";//输出A
                	}
                	else if (n >= 10 && n < 20)//否则如果重量大于等于10并且重量小于20
                	{
                		cout << "B";//输出B
                	}
                	else if (n >= 20 && n < 30)//否则如果重量大于等于20并且重量小于40
                	{
                		cout << "C";//输出C
                	}
                	else if (n >= 30 && n < 50)//否则如果重量大于等于40并且重量小于50
                	{
                		cout << "D";//输出D
                	}
                	else//否则
                	{
                		cout << "E";//输出E
                	}
                	return 0;
                }
                //一手交赞一手交货
                
                • 0
                  @ 2023-8-11 21:19:10

                  #include <bits/stdc++.h>//先赞后看,已成习惯 using namespace std; int main() { int weight; cin>>weight;//输入重量 if (weight<10) { cout<<"A"; }//小于10公斤的用A型 if (weight>=10) { if (weight<=20) { cout<<"B"; } }//大于等于10公斤小于20公斤的用B型 if (weight>=20) { if (weight<=40) { cout<<"C"; } }//大于等于20公斤小于40公斤的用C型 if (weight>=40) { if (weight<=50) { cout<<"D"; } }//大于等于40公斤的小于50公斤的用D型 if (weight>=50) { if (weight<=80) { cout<<"E"; } }//大于等于50公斤小于80公斤的用E型 return 0; }

                  • 0
                    @ 2023-8-11 18:43:13
                    # 具体数据被怪盗基德偷走了,自己填!
                    #include <bits/stdc++.h> 
                    using namespace std;
                    int main()
                    {
                        
                        # 
                        if ()
                        {
                            cout<<"";
                        }
                        if ()
                        {
                            cout<<"";
                        }
                        if ()
                        {
                            cout<<"";
                        }
                        if ()
                        {
                            cout<<"";
                        }
                        if ()
                        {
                            cout<<"";
                        }
                        return 0;
                    }
                    
                    • 0
                      @ 2023-8-7 10:06:28
                      #include <iostream>
                          using namespace std;
                          int main()
                          {
                              int a;
                              cin >> a;
                              if (a<10)
                              {
                                  cout << "A";
                              }
                              if (a<20 and a>=10)
                              {
                                  cout << "B";
                              }
                              if (a<40 and a>=20)
                              {
                                  cout << "C";       
                              }
                              if (a<50 and a>=40)
                              {
                                  cout << "D";
                              }
                              if (a<80 and a>=50)
                              {
                                  cout << "E";
                              }
                              return 0;
                          }//一手交赞,一手交代码
                      
                      • 0
                        @ 2023-8-6 13:07:53

                        代码在这😄 ehlihjeoijwaiowjr

                        • 0
                          @ 2023-8-3 16:31:54

                          if (a < 10) { cout << "A"; } if (a < 20 and a >= 10) { cout << "B"; } if (a < 40 and a >= 20) { cout << "C"; } //足一判断下去

                          • 0
                            @ 2023-8-3 13:54:15
                            | col1 | col2 | col3 |
                            | --- | --- | --- |
                            |  |  |  |
                            |  |  |  |#include
                            using namespace std;
                            int main()
                            {
                                int n;
                                cin>>n;
                                if(n<10)
                                {
                                    cout<<"A";
                                }
                                if(n>=10)
                                {
                                    if(n<20)
                                    {
                                        cout<<"B";
                                    }
                                }
                                if(n>=20)
                                {
                                    if(n<40)
                                    {
                                        cout<<"C";
                                    }
                                }
                                if(n>=40)
                                {
                                    if(n<50)
                                    {
                                        cout<<"D";
                                    }
                                }
                                if(n>=50)
                                {
                                    if(n<80)
                                    {
                                        cout<<"E";
                                    }
                                }
                                return 0;
                            }
                            
                            • 0
                              @ 2023-8-2 17:07:14
                              //这里我用了好多循环嵌套😄 
                              //不知道有没有和我一样闲的👀️ 
                              ---
                              #include <iostream>
                              using namespace std;
                              int main()
                              {
                                  int n;
                                  cin >> n;
                                  if (n < 10)  //小于10单独列出
                                  {
                                      cout << "A" << endl;
                                  }
                                  else  //大于等于10中分类
                                  {
                                      if (n < 40)  //小于40(同时大于等于10)
                                      {
                                          if (n < 20)  //小于20(同时大于等于10)
                                          {
                                              cout << "B" << endl;
                                          }
                                          else  //大于等于20(同时小于40)
                                          {
                                              cout << "C" << endl;
                                          }
                                      }
                                      else  //大于等于40
                                      {
                                          if (n < 50)  //小于50(同时大于等于40)
                                          {
                                              cout << "D" << endl;
                                          }
                                          else  //大于等于50(题目中说了小于80,所以就不列啦)
                                          {
                                              cout << "E" << endl;
                                          }
                                      }
                                  }
                                  return 0;
                              }
                              
                              • 0
                                @ 2023-8-2 15:23:39
                                #include<bits/stdc++.h>
                                using namespace std;
                                int main()
                                {
                                    int x;
                                    cin>>x;
                                    if (x>=0)
                                    {
                                        cout<<x;
                                    }
                                    else
                                    {
                                        cout<<x-x-x;
                                    }
                                    return 0;
                                }
                                
                                
                                • 0
                                  @ 2023-8-2 15:17:12

                                  #include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if (a<10) { cout<<"A"; } if (10<=a<20) { cout<<"B"; } if (20<=a<40) { cout<<"C"; } if (40<=a<50) { cout<<"D"; } if (50<=a<80) { cout<<"E"; } return 0; }

                                  • 0
                                    @ 2023-8-2 15:02:22

                                    #include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if (a<10) { cout<<"A"; } if (10<=a<20) { cout<<"B"; } if (20<=a<40) { cout<<"C"; } if (40<=a<50) { cout<<"D"; } if (50<=a<80) { cout<<"E"; } return 0; }

                                    • 0
                                      @ 2023-8-1 14:26:02
                                      #include <iostream>
                                      using namespace std;
                                      int main()
                                      {
                                          int x;
                                          cin >> x;
                                          if (x < 10)
                                          {
                                              cout << "A";
                                          }
                                          else if (x < 20)
                                          {
                                              cout << "B";
                                          }
                                          else if (x < 40)
                                          {
                                              cout << "C";
                                          }
                                          else if (x < 50)
                                          {
                                              cout << "D";
                                          }
                                          else if (x < 80)
                                          {
                                              cout << "E";
                                          }
                                          return 0;
                                      }
                                      
                                      • 0
                                        @ 2023-8-1 10:26:18

                                        5个if语句就行,代码来喽!

                                        #include <iostream>
                                        using namespace std;
                                        int main()
                                        {
                                            int doge;//定义1个变量
                                            cin >> doge;//输入这个变量
                                            if (doge<10)//小于10的用A
                                            {
                                                cout << "A";
                                            }
                                            if (doge>=10 && doge<20)//大于等于10并且小于20的用B
                                            {
                                                cout << "B";
                                            }
                                            if (doge>=20 && doge<40)//大于等于20并且小于40的用C
                                            {
                                                cout << "C";
                                            }
                                            if (doge>=40 && doge<50)//大于等于40并且小于50的用D
                                            {
                                                cout << "D";
                                            }
                                            if (doge>=50 && doge<80)//大于等于50并且小于80的用E
                                            {
                                                cout << "E";
                                            }
                                            return 0;
                                        }
                                        

                                        (暗藏狗头)

                                        • @ 2023-8-6 21:11:54

                                          怎么办,我现在连五个if语句内容都想不出来T~T

                                      【入门】找出最经济型的包装箱型号

                                      信息

                                      ID
                                      39
                                      时间
                                      1000ms
                                      内存
                                      16MiB
                                      难度
                                      5
                                      标签
                                      递交数
                                      11191
                                      已通过
                                      4629
                                      上传者