#include
using namespace std;
int main()
{
char *a = new char[3];
cin >> a;
cout << endl;
char *b = new char[3];
cin >> b;
cout << endl;
char *c= new char[3];
cin >> c;
cout << endl;
int p;
p = strcmp(a, b);
if (p > 0)
swap(a, b);
int q;
q = strcmp(a, c);
if (q > 0)
swap(a, c);
int g;
g = strcmp(b, c);
if (g > 0)
swap(b, c);
cout << a[0] << “\t” << a[1] << “\t” << a[2]<<endl;
cout << b[0] << “\t” << b[1] << “\t” << b[2]<<endl;
cout << c[0] << “\t” << c[1] << “\t” << c[2]<<endl;
delete a;
delete b;
delete c;
system(“pause”);
}
void swap(char *pa, char *pb)
{
char temp;
temp = *pa;
*pa = *pb;
*pb = temp;
}
第六题
最新推荐文章于 2022-03-07 14:45:29 发布