资深天翼
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a>b){
if(b>c){
cout<<b<<" "<<c<<" "<<a;
}else{
cout<<a<<" "<<c<<" "<<b;
}
}else{
if(a<c){
cout<<c<<" "<<a<<" "<<b;
}else{
cout<<b<<" "<<c<<" "<<a;
}
}
return 0;
}
资深守护
- #include<iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a<b&&a<c&&b<c) { cout<<a<<' '<<b<<' '<<c; } else if(a<b&&a<c&&c<b) { cout<<a<<' '<<c<<' '<<b; }else if(b<a&&b<c&&a<c) { cout<<b<<' '<<a<<' '<<c; }else if(b<a&&b<c&&c<a) { cout<<b<<' '<<c<<' '<<a; }else if(c<a&&c<b&&a<b) { cout<<c<<' '<<a<<' '<<b; }else if(c<a&&c<b&&b<a) { cout<<c<<' '<<b<<' '<<a; } return 0; }
资深天翼
- #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <exception> #include <fstream> #include <functional> #include <limits> #include <list> #include <map> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <utility> #include <vector> #include <cwchar> #include <cwctype> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a>b){ if(b>c){ cout<<b<<" "<<c<<" "<<a; }else{ cout<<c<<" "<<b<<" "<<a; } }else{ if(c>a){ cout<<a<<" "<<c<<" "<<b; } } return 0; }
中级守护
In file included
from
/usr/include/c++/9/bits/char_traits.h:39,
from
/usr/include/c++/9/ios:40,
from
/usr/include/c++/9/ostream:38,
from
/usr/include/c++/9/iostream:39,
from
main.cpp:1: /usr/include/c++/9/bits/stl_algobase.h:
In instantiation of
constexpr const _Tp&
std::max(const _Tp&,
const _Tp&, _Compare)
[with _Tp = int; _Comp
are = int]’: main.cpp
:16:21: required from h
ere /usr/include/c++/9/bit
/stl_algobase.h:271:17: error:
‘__comp’ cannot be used as a functio
n 271 | if (__comp(__a, __b)) |
~~~~~~^~~~~~~~~~
/usr/include/c++/9/bits/stl_algobase.h:
In instantiation of ‘
constexpr const _Tp&
std::min(const _Tp&,
const _Tp&, _Compare)
[with _Tp = int; _Compare
= int]’: main.cpp:19:26: requ
ired from here /usr/include/c++/9
bits/stl_algobase.h:249:17: error: ‘_
_comp’ cannot be used as a function 249 |
if (__comp(__b, __a)) |
~~~~~~^~~~~~~~~~