Skip to content
Snippets Groups Projects
procedure-loop_no_1.cpp 454 B
Newer Older
frederic gruau's avatar
frederic gruau committed
#include <iostream>
#include <vector>
using namespace std;

void  blourg(vector<int> t, int v, int i, bool &b) {
    i=-1;
    b=false;
    for( int j=0; j<t.size();j++) {
            if(t[j]  == v) {
                i=j;
                b=true;
            }
    }
int main() {
    bool  toto;
frederic gruau's avatar
frederic gruau committed
    vector<int> tab = {4, 10, 13, 7, 5, 6};
    int s = 0;
    blourg(tab,2,s,toto);
    if(toto) cout << s << endl;
    else  cout << "blourg" << endl;
}