Skip to content
Snippets Groups Projects
Commit 7cf509ae authored by frederic gruau's avatar frederic gruau
Browse files

j'ai changé les noms

parent 5b16ef47
No related branches found
No related tags found
No related merge requests found
#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;
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;
}
#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;
vector<int> tab = {4, 10, 13, 7, 5, 6};
int s = 0;
blourg(tab,5,s,toto);
if(toto) cout << s << endl;
else cout << "blourg" << endl;
}
#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;
vector<int> tab = {4, 10, 13, 7, 5, 6};
int s = 0;
blourg(tab,5,s,toto);
if(toto) cout << s << endl;
else cout << "blourg" << endl;
}
#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;
vector<int> tab = {4, 10, 13, 7, 5, 6};
int s = 0;
blourg(tab,5,s,toto);
if(toto) cout << s << endl;
else cout << "blourg" << endl;
}
//============================================================================
// Name : testCpp.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
void decrement(int n) {
n=n-1;
}
int main() {
int a = 5;
decrement(a);
cout << a << endl;
}
//============================================================================
// Name :
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
void decrement(int &n) {
n=n-1;
}
int main() {
int a = 5;
decrement(a);
cout << a << endl;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment