4 条题解

  • 1
    @ 2023-8-30 16:42:36

    Python的哦~

    a=input().split()
    x=a[0]
    y=a[1]
    if x>y:
        print(x)
    else:
        print(y)
    
    • 1
      @ 2023-7-16 19:36:02
      #include <iostream>
      using namespace std;
      
      int main()
      {
          int a,b;
          cin>>a>>b;
          if(a>b){
              cout<<a<<endl;
          }else{
              cout<<b<<endl;
              }
          return 0;
      }
      
      
      • 1
        @ 2021-9-13 10:36:59

        没水过题解, 就赶紧来水一篇.

        #include <iostream>
        #include <algorithm>
        #include <cstdio>
        #include <cstring>
        
        using namespace std;
        
        
        
        int main()
        {
        	ios::sync_with_stdio(0);
        	cin.tie(0);
        	int a, b;
        	cin >> a >> b;
        	cout << ((a>b) ? a : b) << endl;
        	return 0;
        }
        
        • 0
          @ 2023-3-30 13:48:59

          本蒟蒻的第五篇\texttt{\large\color{#12a1e8}本蒟蒻的第五篇\color{#92a1e8}题\color{#92b1d8}解}

          求两数中的较大者{\large\color{#92a1e8}求两数中的较大者}

          难度:入门\texttt{\small\color{#e51211}难度:入门}


          max(a,b)可以自动读取较大的数值,且其语法在python和c++中相同


          Python{\large\color{#52a1e8}Python:}

          a,b=map(int,input().split())
          print(max(a,b))
          

          C++{\large\color{#52a1e8}C++:}

          #include<iostream>
          using namespace std;
          int a,b;
          int main(){
              cin>>a>>b;
              cout<<max(a,b)<<endl;
              return 0;
          }
          
          • 1

          【苏州NOI】d004: 求两数中的较大者

          信息

          ID
          11
          时间
          1000ms
          内存
          128MiB
          难度
          2
          标签
          递交数
          701
          已通过
          439
          上传者