#51435: c++正解跟思路 (想學再點)


yp11451032@yphs.tp.edu.tw (711-23吳嘉恩)

學校 : 不指定學校
編號 : 312870
來源 : [203.72.178.2]
最後登入時間 :
2025-10-09 17:59:35

#include <iostream>
using namespace std;
int main(){
    int a, b=0, e, d=0;//宣告
    cin>>a;   
    for(int c=0;c<a;c++){//重複執行 語句,直到條件變成 false 為止。
        cin>>e;
            if(e>b)//如果
                b=e;
            else
                b=b;
}
    cout<<b<<endl;
    return 0;
}