60 条题解

  • 0
    @ 2023-12-30 18:04:22

    #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n;

    if (n < 200){ cout << n; return 0; }

    if (n < 300){ cout << n+50; return 0; }

    if (n < 500){ cout << n+100; return 0; }

    cout << n+200; }

    • 0
      @ 2023-11-26 17:53:16
      #include <iostream>
      using namespace std;
      int main()
      {
      	int n,sum=0;
      	cin >> n;
      	if (n>=200){
              if (n<=299){
                  sum=n+50;
              }
          }
          if (n>=300){
              if (n<=499){
                  sum=n+100;
              }
          }
          if (n>=500){
              sum=n+200;
          }
          if (n<200){
              sum=n;
          }
          cout<<sum<<endl;
      }
      
      • 0
        @ 2023-11-19 22:24:11
        #include <bits/stdc++.h>
            using namespace std;
            int main()
            {
                int a,sum;
                cin >> a;
                sum = a;
                if (a<=299 and a>=200)
        //充值200元~299元的
                {
                    sum += 50;
                }
                if (a<=499 and a>=300)
        //充值300元~499元的
                {
                    sum += 100;
                }
                if (a>=500)
        充值500元以上的
                {
                    sum += 200;
                }
                cout << sum;
                return 0;
            }
        

        点个赞吧

        • 0
          @ 2023-11-18 9:33:59
          #include <iostream>
          using namespace std;
          
          int main()  
          {
              int n;
              cin>>n;
              if(n<200)
              {
                  cout<<n;
              }
              else if(n>=500)
              {
                  n=n+200;
                  cout<<n;
              }
              else if(n>=300)
              {
                  n+=100;
                  cout<<n;
              }
              else if(n>=200)
              {
                  n+=50;
                  cout<<n;
              }
              return 0;
          }
          
          
          • 0
            @ 2023-11-18 9:33:31
            #include <iostream>
            using namespace std;
            
            int main()  
            {
                int n;
                cin>>n;
                if(n<200)
                {
                    cout<<n;
                }
                else if(n>=500)
                {
                    n=n+200;
                    cout<<n;
                }
                else if(n>=300)
                {
                    n+=100;
                    cout<<n;
                }
                else if(n>=200)
                {
                    n+=50;
                    cout<<n;
                }
                return 0;
            }
            
            
            • 0
              @ 2023-11-12 10:28:01
              #include <bits/stdc++.h>
                  using namespace std;
                  int main()
                  {
                      int a,sum;
                      cin >> a;
                      sum = a;
                      if (a<=299 and a>=200)
                      {
                          sum += 50;
                      }
                      if (a<=499 and a>=300)
                      {
                          sum += 100;
                      }
                      if (a>=500)
                      {
                          sum += 200;
                      }
                      cout << sum;
                      return 0;
                  }
              
              • 0
                @ 2023-11-5 12:22:53

                //主要是判断多,其他都没啥 #include<bits/stdc++.h> using namespace std; int main(){ int a; cin >> a; if(a < 200) cout << a; else if(a < 300) cout << a + 50; else if(a < 500) cout << a + 100; else cout << a + 200; return 0; }

                • 0
                  @ 2023-10-3 11:41:26
                  #include <iostream>
                  using namespace std;
                  int main()
                  {
                      int a;
                      cin >> a;
                      if (a >= 200 and a <= 299)
                      {
                          cout << a + 50;
                      }
                      if (a >= 300 and a <= 499)
                      {
                          cout << a + 100;
                      }
                      if (a >= 500)
                      {
                          cout << a + 200;
                      }
                      if (a < 200)
                      {
                          cout << a;
                      }
                      return 0;
                  }
                  
                  • 0
                    @ 2023-10-3 11:40:51
                    #include <iostream>
                    using namespace std;
                    int main()
                    {
                        int a;
                        cin >> a;
                        if (a >= 200 and a <= 299)
                        {
                            cout << a + 50;
                        }
                        if (a >= 300 and a <= 499)
                        {
                            cout << a + 100;
                        }
                        if (a >= 500)
                        {
                            cout << a + 200;
                        }
                        if (a < 200)
                        {
                            cout << a;
                        }
                        return 0;
                    }
                    
                    • 0
                      @ 2023-9-17 18:05:50
                      #include <iostream>
                      using namespace std;
                      int main()
                      {
                          int n;
                          cin >> n;
                          if (n >= 500)
                          {
                              cout << n + 200;
                          }
                          else if (n >= 300)
                          {
                              cout << n + 100;
                          }
                          else if (n >= 200)
                          {
                              cout << n + 50;
                          }
                          else
                          {
                              cout << n;
                          }
                          return 0;
                      }
                      
                      • 0
                        @ 2023-8-29 17:08:21
                        #include<iostream>
                        using namespace std;
                        int main()
                        {
                            int n;
                            cin>>n;
                            if(n<200)
                            {
                                cout<<n;
                            }
                            else if(n<300)
                            {
                                cout<<n+50;
                            }
                            else if(n<500)
                            {
                                cout<<n+100;
                            }
                            else if(n>=500)
                            {
                                cout<<n+200;
                            }
                            return 0;
                        我为啥要用4个if:<
                        
                        • 0
                          @ 2023-8-27 23:00:51
                          #include <bits/stdc++.h>//万能开头
                          using namespace std;
                          int n;//定义变量
                          int main()
                          {
                              cin>>n;//输入变量
                              if(n<200)//if,else if,else语句
                              {
                                  cout<<n;
                              }
                              else if(n>=200&&n<=299)//“&&”表示以及(and)
                              {
                                  cout<<n+50;
                              }
                              else if(n>=300&&n<=499)
                              {
                                  cout<<n+100;
                              }
                              else
                              {
                                  cout<<n+200;
                              }
                              return 0;
                          }
                          
                          //一手交赞,一手交货(代码)
                          
                          
                          
                          
                          
                          
                          //核桃hetao1609095编程
                          //水印
                          
                          • 0
                            @ 2023-8-27 17:34:26

                            #include <iostream> using namespace std; int main() { int n; cin>>n; if (n<200) { cout<<n; } if (n>=200 and n<300) { cout<<n+50; } if (n>=300 and n<500) { cout<<n+100; } if (n>=500) { cout<<n+200; } return 0; }

                            • 0
                              @ 2023-8-13 13:44:36

                              #include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if (a>=200 and a<=299) { cout<<a+50; } if (a>=300 and a<=499) { cout<<a+100; } if (a>=500) { cout<<a+200; } if (a<200) { cout<<a; } return 0; }

                              • 0
                                @ 2023-8-2 15:36:55
                                #include<bits/stdc++.h>
                                using namespace std;
                                int main()
                                {
                                    int x;
                                    cin>>x;
                                    if (x>=200)
                                    {
                                        if (x>=300)
                                        {
                                            if (x>=500)
                                            {
                                                cout<<x+200;
                                            }
                                            else
                                            {
                                                cout<<x+100;
                                            }
                                        }
                                        else
                                        {
                                            cout<<x+50;   
                                        }
                                    }
                                    else
                                    {
                                        cout<<x;
                                    }
                                    return 0;
                                }
                                
                                • 0
                                  @ 2023-7-30 20:05:53
                                  #include <bits/stdc++.h>
                                  using namespace std;
                                  int main()
                                  {
                                      int s, n;
                                      cin >> s;
                                      if (s >= 200 && s < 300)
                                      {
                                          n = s + 50;
                                          cout << n;
                                      }
                                      if (s >= 300 && s < 500)
                                      {
                                          n = s + 100;
                                          cout << n;
                                      }
                                      if (s >= 500)
                                      {
                                          n = s + 200;
                                          cout << n;
                                      }
                                      if (s < 200)
                                      {
                                          cout << s;
                                      }
                                      return 0;
                                  }
                                  
                                  
                                  
                                  • 0
                                    @ 2023-5-6 21:26:56

                                    #include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if (a<=299 and a>=200) { cout<<a+50; } if (a<=499 and a>=300) { cout<<a+100; } if (a>=500) { cout<<a+200; } if (a<200) { cout<<a; } return 0; }

                                    • 0
                                      @ 2023-5-6 21:25:36

                                      #include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if (a<=299 and a>=200) { cout<<a+50; } if (a<=499 and a>=300) { cout<<a+100; } if (a>=500) { cout<<a+200; } if (a<200) { cout<<a; } return 0; }

                                      • 0
                                        @ 2023-5-6 21:24:52

                                        #include <bits/stdc++.h> using namespace std; int main() { int a; cin>>a; if (a<=299 and a>=200) { cout<<a+50; } if (a<=499 and a>=300) { cout<<a+100; } if (a>=500) { cout<<a+200; } if (a<200) { cout<<a; } return 0; }

                                        • 0
                                          @ 2023-4-15 21:12:20

                                          #include<iostream> using namespace std; int main() { int n; cin>>n; if(n<200) { cout<<n; } else if(n<300) { cout<<n+50; } else if(n<500) { cout<<n+100; } else { cout<<n+200; } return 0; }

                                          【入门】公交卡充值问题?

                                          信息

                                          ID
                                          388
                                          时间
                                          1000ms
                                          内存
                                          16MiB
                                          难度
                                          5
                                          标签
                                          递交数
                                          12429
                                          已通过
                                          4507
                                          上传者