请教大神一个问题,麻烦解答一下我的疑惑,谢谢
千羽s 2019-05-07 11:10:24 #include<iostream>
using namespace std;
void swaps(int *pt1,int *pt2)
{
int a;
a = *pt1;
*pt1 = *pt2;
*pt2 = a;
}
void swap(int *p1,int *p2,int *p3)
{
if (*p1 < *p2) swaps(p1, p2);
if (*p1 < *p3) swaps(p1, p2);
if (*p2 < *p3) swaps(p2, p3);
}
int main()
{
int a, b, c;
cin >> a >> b >> c;
swap(&a, &b, &c);
cout << *p1 << endl << *p2 << endl << *p3 << endl;
}
这个哪里出错啦?