111 条题解

  • 0
    @ 2022-10-24 12:31:59
    #include <iostream>//头文件
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        if (n<10)
        {
            cout << "A";
        }
        if (n<20 and n>=10)
        {
            cout << "B";
        }
        if (n<40 and n>=20)
        {
            cout << "C";       
        }
        if (n<50 and n>=40)
        {
            cout << "D";
        }
        if (n<80 and n>=50)
        {
            cout << "E";
        }
        return 0;
    }
    
    • 0
      @ 2022-10-24 12:30:57
      #include <iostream>
      using namespace std;
      int main()
      {
          int n;
          cin >> n;
          if (n<10)
          {
              cout << "A";
          }
          if (n<20 and n>=10)
          {
              cout << "B";
          }
          if (n<40 and n>=20)
          {
              cout << "C";       
          }
          if (n<50 and n>=40)
          {
              cout << "D";
          }
          if (n<80 and n>=50)
          {
              cout << "E";
          }
          return 0;
      }
      
      • 0
        @ 2022-9-30 21:30:15

        好吧,很闲的发一个题解(求赞) #include<bits/stdc++.h> using namespace std; int a,b[5]={0,10,20,40,50}; char x=65; int main() { cin>>a; for(int i=1;i<=5;i++) if(a>=b[i]) x++; cout<<x; return 0; } #希望不会被删掉 暴徒随意

        • 0
          @ 2022-9-1 19:54:15

          int n; cin >> n; if (n < 10) { cout << "A"; } else { if (n >= 10 and n < 20) { cout << "B"; } else { if (n >= 20 and n < 40) { cout << "C"; } else { if (n >= 40 and n < 50) { cout << "D"; } else { if (n >= 50 and n < 80) { cout << "E"; } } } } }

          • 0
            @ 2022-8-29 9:51:39
            #include <iostream>
            
            int main()
            {
                using namespace std;
            
                long long n;
                cin >> n;
                n < 10 ? cout << "A" : n < 20 ? cout << "B" : n < 40 ? cout << "C" : n < 50 ? cout << "D" : cout << "E";
                
                return 0;
            }
            

            上来就是一个三目运算符( 为什么写这么长不换行? 用的VS2022写 核OJ提交,这个长度在VS2022里才2/3

            • 0
              @ 2022-8-26 19:20:46

              55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555

              • 0
                @ 2022-8-22 18:15:30

                嘻嘻,简洁的代码来喽!!

                image

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

                最后一个判断我省略了,有兴趣的可以自己加一下

                • 0
                  @ 2022-8-21 21:31:13

                  这个就是代码复杂了点

                  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";
                      }
                  
                  • 0
                    @ 2022-8-21 18:05:05

                    核心代码:if..else语句

                    if(n<10)
                          cout<<"A";
                        if(n>=10&&n<20)
                          cout<<"B";
                        if(n>=20&&n<40)
                          cout<<"C";
                        if(n>=40&&n<50)
                          cout<<"D";
                        if(n>=50)
                          cout<<"E";
                    

                    完整代码

                    #include<bits/stdc++.h>
                    using namespace std;
                    int main(){
                        int n;
                        cin>>n;
                        if(n<10)
                          cout<<"A";
                        if(n>=10&&n<20)
                          cout<<"B";
                        if(n>=20&&n<40)
                          cout<<"C";
                        if(n>=40&&n<50)
                          cout<<"D";
                        if(n>=50)
                          cout<<"E";
                        return 0;
                    }
                    
                    • 0
                      @ 2022-8-21 11:23:40

                      对于初学者来说,除了代码多了一点,其实很简单。

                      #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;
                      }
                      very  滴 good!
                      
                      • 0
                        @ 2022-8-18 19:42:04

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

                        • 0
                          @ 2022-8-3 21:06:19

                          这题也没什么难点,只用多一点的else if即可

                          ```
                          #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;
                          }
                          ```
                          
                          • -1
                            @ 2023-11-30 13:46:35
                            #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;
                            }
                            
                            
                            
                            • -1
                              @ 2023-11-20 19:52:21

                              上代码😄 我要赞赞🎉️ #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; }

                              • -1
                                @ 2023-11-20 19:46:56
                                #include <iostream>
                                using namespace std;
                                int main()
                                {
                                	int n;
                                	cin >> n;
                                    if(n<10)
                                    {
                                    cout<<"A"<<endl;
                                    }
                                    if(n>=10&&n<20)
                                    {
                                    cout<<"B"<<endl;
                                	}
                                	if(n>=20&&n<40)
                                	{
                                 	 cout << "C"<<endl;
                                	}
                                    if(n>=40&&n<50)
                                    {
                                    cout<<"D"<<endl;
                                	}
                                	if(n>=50)
                                	{
                                 	 cout << "E"<<endl;
                                	}
                                	return 0;
                                }
                                

                                点个赞吧

                                • -1
                                  @ 2023-11-12 12:08:49
                                  #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";
                                      }
                                  
                                      
                                  }
                                  
                                  • -1
                                    @ 2023-11-12 10:17:52
                                    #include <iostream>
                                    using namespace std;
                                    int main()
                                    {
                                        int a;
                                        cin >> a;
                                        if (a < 10)
                                        {
                                            cout<<"A";
                                        }
                                        if (a >= 10 and a < 20)
                                        {
                                            cout<<"B";
                                        }
                                        if (a >= 20 and a < 40)
                                        {
                                            cout<<"C";
                                        }
                                        if (a >= 40 and a < 50)
                                        {
                                            cout<<"D";
                                        }
                                        if (a >= 50 and a < 80)
                                        {
                                            cout<<"E";
                                        }
                                        return 0;
                                    }
                                    保护题解一片净土!!!
                                    
                                    • -1
                                      @ 2023-9-23 21:45:02
                                      #include <iostream>
                                      using namespace std;
                                      int main()
                                      {
                                          int x;
                                          cin >> x;
                                          if(x<10)
                                          {
                                              cout << "A";
                                          }
                                          if(x>=10)
                                          {
                                              if(x<20)
                                              {
                                                  cout << "B";
                                              }
                                          }
                                          if(x>=20)
                                          {
                                              if(x<40)
                                              {
                                                  cout <<"C";
                                              }
                                          }
                                          if(x>=40)
                                          {
                                              if(x<50)
                                              {
                                                  cout << "D";
                                              }
                                          }
                                          if(x>=50)
                                          {
                                              cout << "E";
                                          }
                                          return 0;
                                      }
                                      
                                      • -1
                                        @ 2023-9-16 21:13:16
                                        # <
                                        #include <iostream>
                                        using namespace std;
                                        int main()
                                        {
                                        	int n;
                                        	cin >> n;
                                            if(n<10)
                                            {
                                            cout<<"A"<<endl;
                                            }
                                            if(n>=10&&n<20)
                                            {
                                            cout<<"B"<<endl;
                                        	}
                                        	if(n>=20&&n<40)
                                        	{
                                         	 cout << "C"<<endl;
                                        	}
                                            if(n>=40&&n<50)
                                            {
                                            cout<<"D"<<endl;
                                        	}
                                        	if(n>=50)
                                        	{
                                         	 cout << "E"<<endl;
                                        	}
                                        	return 0;
                                        }
                                        
                                        • -1
                                          @ 2023-9-10 18:16:37

                                          #include <iostream> using namespace std; int main() { int n; cin>>n; if(n<10){ cout<<"A"; } else{ if(n<20){ cout<<"B"; } else{ if(n<40){ cout<<"C"; } else{ if(n<50){ cout<<"D"; } else{ cout<<"E"; } } } } return 0; } 先点赞!!!! 100分答案!!!

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

                                          信息

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