题解!!!

LZOI666  •  1年前


include

using namespace std; int main() {

int a,b,c;
cin>>a>>b>>c;
if(a>b&&a>c&&b>=c)
{
	cout<<b<<endl;
}
if(a>b&&a>=c&&c>b)
{
	cout<<c<<endl;
}
if(a<=b&&a>=c&&b>c)
{
	cout<<a<<endl;
}
if(a<=b&&a<c&&b<=c)
{
	cout<<b<<endl;
}
if(a>=b&&a<=c&&c>b)
{
    cout<<a<<endl;
}
if(a<=c&&a<b&&b>=c)
{
	cout<<c<<endl;
}
return 0;

}


评论:

希丰展?使md。


ZZQ  •  1年前

哪里用得着你这么麻烦?看我的,上代码!你自己理解。

include <bits/stdc++.h>

using namespace std;

int main() {

int a,b,c,t;
cin>>a>>b>>c;
if(a>b)
{
	t=a;
	a=b;
	b=t;
}
if(a>c)
{
	t=a;
	a=c;
	c=t;
}
if(b>c)
{
	t=b;
	b=c;
	c=t;
}
cout<<b<<endl;
return 0;

}


潘璇  •  2个月前