W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
#include
#include
#include
using namespace std; int main() { vector
numbers = {1, 7, 3, 5, 9, 2}; auto it = max_element(numbers.begin(), numbers.end()); if (it != numbers.end()) { cout << *it << " 是最大值"; } else { cout << "向量为空"; } return 0; }