题解 | #求最大值#
求最大值
https://www.nowcoder.com/practice/d54521e5efa242e8a7fd6ae36f6cf70d
#include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { int n; vector<int>v; while (cin >> n) { v.push_back(n); for (int i = 0; i < 9; i++) { cin >> n; v.push_back(n); } cout << "max=" << *max_element(v.begin(), v.end()) << endl; v.clear(); } } // 64 位输出请用 printf("%lld")
qd