Skip to content

Instantly share code, notes, and snippets.

@growlnx
Last active February 10, 2018 22:30
Show Gist options
  • Select an option

  • Save growlnx/821aac9a30be92ff76ad53aa951f2977 to your computer and use it in GitHub Desktop.

Select an option

Save growlnx/821aac9a30be92ff76ad53aa951f2977 to your computer and use it in GitHub Desktop.
#include "iostream"
#include "vector"
using namespace std;
double max(vector<double> vetor){
double maior= fila[0];
for(short i = 1; i < fila.size(); i++){
if(fila[i] > maior)
maior = fila[i];
}
return maior;
}
int main(void){
vector<double> fila = {1.8, 1.7, 1.6, 1.88, 1.9};
cout << max(fila) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment