Facebook
From Diminutive Flamingo, 2 Years ago, written in C++.
This paste is a reply to MaxValue from Magda2137 - view diff
Embed
Download Paste or View Raw
Hits: 213
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int findMaxValue (vector <int> numbers);
  5. int main() {
  6.     int a = 4, b = 2, c = 5;
  7.  
  8.     cout << "max value is "<< findMaxValue({a, b, c}) << endl;
  9.  
  10.     return 0;
  11. }
  12. int findMaxValue (vector <int> numbers){
  13.     int max = numbers[0];
  14.     for (int number : numbers){
  15.         if (max < number)
  16.             max = number;
  17.  
  18.     }
  19.     return max;
  20. }

Replies to Re: MaxValue rss

Title Name Language When
Re: Re: MaxValue Whipped Monkey cpp 2 Years ago.