#35434: c++ initializer list


krameri120 (科科)

學校 : 國立臺南高級工業職業學校
編號 : 102318
來源 : [118.231.192.42]
最後登入時間 :
2024-05-17 17:57:08
d065. 三人行必有我師 (1 行版) -- 板橋高中教學題 | From: [36.237.211.114] | 發表日期 : 2023-06-02 19:37

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    constexpr int size = 3;
    int line[size] = {0};
    for (auto &x : line){
        cin >> x;
    }
    cout << max({line[0], line[1], line[2]});
    return 0;
}

 
ZeroJudge Forum