5 条题解

  • 2
    @ 2025-10-6 18:30:51
    #include <iostream>
    using namespace std;
    int main()
    {
    	int a,b,c;
    	cin >> a >> b >> c;
        cout << max(max(a,b),c);
        
    	return 0;
    }
    
    • 1
      @ 2026-1-26 15:34:05
      #include <iostream>
      using namespace std;
      int main()
      {
          int a,b,c;
          cin >> a >> b >> c;
          if (a >= b)
          {
              if (a >= c)
              {
                  cout << a;
                  return 0;
              }
              else 
              {
                  cout << c;
                  return 0;
              }
          }
          else if (b >= c)
          {
              cout << b;
              return 0;
          }
          else
          {
              cout << c;
              return 0;
          }
      }
      • 1
        @ 2025-1-28 22:20:28

        @System Error 你不放代码是什么意思呀

        #include<bits/stdc++.h>
        using namespace std;
        const int N=1e5+5,INF=0x3f3f3f3f;
        int a,b,c;
        int main()
        {
        	cin>>a>>b>>c;
        	cout<<max(a,max(b,c));
        	return 0;
        }
        
        • 0
          @ 2025-12-21 20:25:12

          简单又粗暴地拿下AC

          #include<bits/stdc++.h>
          using namespace std;
          
          int main(){
          	int a,max=-999999;
          	for(int i=1;i<=3;i++){
          		cin>>a;
          		if(max<a){
          			max=a;
          		}
          	}
          	cout<<max;
          	return 0;
          }
          
          • -2
            @ 2021-12-4 12:19:22

            max函数:返回两个数中较大的一个数
            包括库:

            #include <cmath>
            

            语法:

            max(double x, double y);
            

            作用: 返回x, y 中的最大值
            本题思路: 输入三个数a,b,c ,对a和b取最大值后再与c取最大值,即

            max(max(a,b),c);
            

            即可。

            • @ 2025-10-6 18:28:55

              似乎不用 cmath 也能实现 max 函数 吧

          • 1

          信息

          ID
          892
          时间
          1000ms
          内存
          128MiB
          难度
          5
          标签
          递交数
          89
          已通过
          36
          上传者