diff --git a/day6/homework/h8.cpp b/day6/homework/h8.cpp new file mode 100644 index 0000000..5c0df10 --- /dev/null +++ b/day6/homework/h8.cpp @@ -0,0 +1,15 @@ +#include + +using namespace std; + +int main() +{ + int a, b, c; + cout << "请输入三个数: "; + cin >> a >> b >> c; + + int max = a > b ? (a > c ? a : c) : (b > c ? b : c); + cout << "其中最大的数是: " << max << endl; + + return 0; +} \ No newline at end of file