输入3个字符串,将它们按照字母由大到小排序

.用string方法定义字符串变量

实现代码:

#include
#include
using namespace std;
int main(){
	string a,b,c,t;
	cout<<"please input first string:"<>a;
	cout<<"please input second string:"<>b;
	cout<<"please input third string:"<>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<


转载于:https://www.cnblogs.com/zhezh/p/3773429.html

你可能感兴趣的:(输入3个字符串,将它们按照字母由大到小排序)