5 条题解

  • 1
    @ 2026-1-28 12:40:39

    好吧,这回重新发一遍,上次可能因为带有一丝挑衅的意思所以有俩差评。

    这道题其实没必要太复杂,又是a>b的又是c>b的,没必要。那该怎么做呢,其实用max函数就行了,想一下既然max函数能让两个数比大小那为什么不能让三个数比大小呢(max(a,max(b,c))) 代码如下:

    #include <bits/stdc++.h>//因为要用max所以不能用iostream
    using namespace std;
    int main()
    {
    	int a,b,c;
    	cin>>a>>b>>c;
    	cout<<max(a,max(b,c));
    }
    

    信息

    ID
    115
    时间
    1000ms
    内存
    256MiB
    难度
    1
    标签
    (无)
    递交数
    215
    已通过
    76
    上传者