72 条题解

  • 0
    @ 2022-8-22 21:50:40

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

    image

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int a , b;
        cin >> a >> b;
        if(a == b) cout << "Y" << endl;
        else cout << "N" << endl;
        cout << a * b;
        return 0;
    }
    
    • 0
      @ 2022-8-21 11:57:13
      using namespace std;
      int main()
      {
          int a,b;
          cin>>a>>b;
          if(a==b)
          {
              cout<<"Y"<<endl;
          }
          else
          {
              cout<<"N"<<endl;
          }
          cout<<a*b;
          return 0;
      }
      
      • 0
        @ 2022-8-20 13:34:34
        #include<iostream>
        using namespace std;
        
        int main()
        {
            int a,b;
            cin>>a>>b;
            if(a==b)
            {
                cout<<"Y"<<endl<<a*b;
            }
            else
            {
                cout<<"N"<<endl<<a*b;
            }
        
            return 0;
        }
        +
        
        • 0
          @ 2022-8-4 19:06:29

          先判断两边是否相等,分别输出“Y”和“N” 然后再输出a*b的积(面积)

          ```
          #include <bits/stdc++.h>
          using namespace std;
          int main()
          {
              int a;
              cin >> a;
              if (a == 1) cout << "swim";
              else if (a == 3) cout << "program";
              else if (a == 5) cout << "read";
              else if (a == 6) cout << "math";
              else cout << "rest";
              return 0;
          }
          ```
          
          • -1
            @ 2023-11-5 16:35:56

            #include <bits/stdc++.h> using namespace std; int a, b; int main() { cin >> a >> b; if(a != b) { cout << "N" << endl << a * b; } else { cout << "Y" << endl << a * b; } return 0; }

            • -1
              @ 2023-9-23 14:20:44

              #include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; if (a == b) { cout << "Y" << endl; cout << a * b << endl; } else { cout << "N" << endl; cout << a * b << endl; } return 0; }

              • -1
                @ 2023-9-2 20:59:54

                这题挺简单的 话不多说,直接上代码(由于太懒,不想多打字,所以只上中间代码)

                int a , b; cin >> a >> b if (a = b) { cout << "Y" << end l << a * b; } else { cout<< "N" << endl << a * b ; } (由于害怕复制,所以故意错了一点,请谅解😄 )

                • -1
                  @ 2023-8-23 0:29:16
                  #include <iostream>
                  #include <cstdio>
                  
                  using namespace std;
                  
                  int main()
                  {
                      int width, height;
                      scanf("%d %d", &width, &height);
                  
                      cout << ((width == height) ? "Y\n" : "N\n") << width * height << endl; // 三元运算符,嘿嘿~~~
                  
                      return 0;
                  }
                  

                  ++点赞数量,球球惹~~~

                • -1
                  @ 2023-8-12 12:07:00
                  #include <bits/stdc++.h>
                  using namespace std;
                  int main()
                  {
                      int a,b;
                      cin>>a>>b;
                      if(a==b)
                      {
                          cout<<"Y"<<endl;//正方形的特性:两条边相等;所以如果相等输出Y;
                      }
                      else
                      {
                          cout<<"N"<<endl;
                      }
                      cout<<a*b;
                      return 0;
                  }
                  
                  • -1
                    @ 2023-8-11 21:33:47

                    这是我第一次发评论``` #include <iostream> using namespace std; int main() { int x,y; cin>>x>>y; if (x==y) { cout<<"Y"<<endl; } else { cout<<"N"<<endl; } cout<<x*y; return 0; }

                    
                    
                    • -1
                      @ 2023-8-11 21:32:11
                      #include <iostream>
                      using namespace std;
                      int main()
                      {
                          int x,y;
                          cin>>x>>y;
                          if (x==y)
                          {
                              cout<<"Y"<<endl;
                          }
                          else
                          {
                              cout<<"N"<<endl;
                          }
                          cout<<x*y;
                          return 0;
                      }
                      
                      • -1
                        @ 2023-8-11 21:13:04

                        最后别忘了return 0

                        #include <iostream>
                        using namespace std;
                        int main()
                        {
                            int a,b;
                            cin>>a>>b;
                            if (a==b)
                            {
                                cout<<"Y"<<endl;
                            }
                            else
                            {
                                cout<<"N"<<endl;
                            }
                            cout<<a*b;
                            return 0;
                        }
                        
                        • -1
                          @ 2023-8-11 16:15:25

                          瓦的电脑快没电了>_<image

                          • -1
                            @ 2023-8-8 20:47:17
                            #include <iostream>
                            using namespace std;
                            int main()
                            {
                                int x,y;
                                cin>>x>>y;
                                if (x==y)
                                {
                                    cout<<"Y"<<endl;
                                }
                                else
                                {
                                    cout<<"N"<<endl;
                                }
                                cout<<x*y;
                            }
                            
                            • -1
                              @ 2023-8-7 10:19:47
                              //这道题挺简单的,就是用一个if语句加上输出就行了,来,上代码!
                              #include<iostream>
                              using namespace std;
                              int main()
                                  {
                                  int a,b;
                                  cin>>a>>b;
                                  if(a==b)
                                  {
                                      cout<<"Y"<<endl<<a*b;
                                  }
                                  else
                                  {
                                      cout<<"N"<<endl<<a*b;
                                  }
                                  return 0;
                              }
                              
                              //编码不易,先点赞,在抱走哦😄 
                              
                              • -1
                                @ 2023-8-6 22:33:18
                                #include <iostream>
                                using namespace std;
                                int main()
                                {
                                	int a,b;
                                    cin>>a>>b;
                                    if(a==b)
                                     {
                                        cout<<"Y"<<endl;
                                        cout<<a*b;
                                     }
                                     else
                                     {
                                        cout<<"N"<<endl;
                                        cout<<a*b;
                                     }   
                                	return 0;
                                }
                                
                                • -1
                                  @ 2023-8-6 21:06:15
                                  #include <bits/stdc++.h>
                                  using namespace std;
                                  
                                  int main() {
                                      int a, b;
                                      cin >> a >> b;
                                      if (a - b)
                                          cout << "N";
                                      else
                                          cout << "Y";
                                      cout << endl << a * b;
                                      return 0;
                                  }
                                  
                                  • -1
                                    @ 2023-8-3 20:55:45

                                    #include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; if (a==b)//判断条件 { cout <<"Y"<<endl;//注意引号 } else { cout <<"N"<<endl; } cout << a*b; return 0; }

                                    • -1
                                      @ 2023-8-1 21:30:49
                                      #include <bits/stdc++.h>
                                          using namespace std;
                                          int main()
                                          {
                                              //               *** 
                                              //              *****
                                              //               ***
                                              //             ********
                                              //           **  ****** **
                                              //           **  ****** **
                                              //               ******
                                              //             **** ****
                                              //            ***    ***
                                              //            ***     ***
                                              int a,b;
                                              cin >> a >> b;
                                              if (a==b)
                                              {
                                                  cout <<"Y"<<endl;
                                              }
                                              else
                                              {
                                                  cout <<"N"<<endl;
                                              }
                                              cout << a*b;
                                              return 0;
                                          }
                                      
                                      • -1
                                        @ 2023-8-1 13:48:48
                                        #include <iostream>
                                        using namespace std;
                                        int main()
                                        {
                                            int i,k;
                                            cin>>i>>k;
                                            if (i==k)
                                            {
                                                cout<<"Y"<<endl<<i*k;
                                            }
                                            else
                                            {
                                                cout<<"N"<<endl<<i*k;
                                            }
                                            return 0;
                                        }
                                        

                                        信息

                                        ID
                                        652
                                        时间
                                        1000ms
                                        内存
                                        16MiB
                                        难度
                                        4
                                        标签
                                        递交数
                                        8891
                                        已通过
                                        4396
                                        上传者