题解 | 最大最小值

最大最小值

https://www.nowcoder.com/practice/051cbca4504d40f5b20bb891d83ec408

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
    int temp=a;
	if(b>a){
		a=b;
		
	}
	if(c>a){
		a=c;
	}
	if(b<c){
		c=b;
	}
	if(temp<c){
		c=temp;
	}
	cout<<"The maximum number is : "<<a<<endl;
	cout<<"The minimum number is : "<<c;
	
	return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务