Skip to content

Instantly share code, notes, and snippets.

@hansen033
Created March 22, 2018 11:16
Show Gist options
  • Save hansen033/c587b032bccd626b171ebc9f77aaf70d to your computer and use it in GitHub Desktop.
Save hansen033/c587b032bccd626b171ebc9f77aaf70d to your computer and use it in GitHub Desktop.
2018/3/22
#include <iostream>
using namespace std;
int main() {
int a, b = 0;
cout << "你想要比較幾個數?";
cin >> a;
int x[a];
for ( int t = 0 ; t < a ; t ++ ){
cin >> x[t];
}
for ( int t = 0 ; t < a ; t ++ ){
if ( x[t] > b ){
b = x[t];
}
}
cout << b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment