#include<bits/stdc++.h> using namespace std; int main() { int minn = 9999999,i = 1,n; //最小值minn,迴圈變數i cin >> n; while(i <= n) //i=1時,寫i<=n可以實現迴圈n次 { int x; cin >> x; //每次迴圈都輸入一個數字x,就可以實現輸入n個數 if(x < minn) minn = x; //如果新輸入的x比minn小,那麼替換 i++; } cout << minn; return 0; }