Skip to content
Snippets Groups Projects
Commit 9b11bc0c authored by Adrien Rougny's avatar Adrien Rougny
Browse files

-data/static/

parent 86edcf13
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 152 deletions
File deleted
#include <iostream>
using namespace std;
int f(int n) {
return 2*n - 1;
}
int main() {
int a = 7;
f(a);
cout << a << endl;
}
File deleted
#include <iostream>
using namespace std;
void f(int x, int y) {
x = x+1;
y = y-1;
}
int main() {
int x,y;
x = 1;
y = 2;
f(y,x);
cout << x << ", " << y << endl;
}
File deleted
#include <iostream>
using namespace std;
int g(int x, int y) {
x = x+1;
return y-1;
}
int main() {
int x,y;
x = 1;
y = 2;
g(x,y);
cout << x << ", " << y << endl;
}
File deleted
#include <iostream>
using namespace std;
int g(int j) {
int resultat = 1;
for ( int k = 1; k <= j; k++ ) {
resultat = resultat * k;
}
return resultat;
}
int main() {
int i;
i = 4;
cout << i << "! = " << g(i) << endl;
return 0;
}
File deleted
#include <iostream>
using namespace std;
int f(int n) {
int i;
int cpt = 0;
for(i=1; i<=n; i++){
cpt = cpt + i;
}
return cpt;
}
int main() {
if (f(5) < 11) {
cout << "Petit" << endl;
}
else {
cout << "Grand" << endl;
}
}
File deleted
#include <iostream>
using namespace std;
int f(int x, int y) {
x = x+1;
return y-1;
}
int main() {
int x,y;
x = 1;
y = 2;
x = f(y,x);
cout << x << ", " << y << endl;
}
File deleted
#include <iostream>
using namespace std;
double max(double a, double b) {
if ( a >= b ) {
return a;
} else {
return b;
}
}
int main() {
cout << max(1.0, 3.0) << endl;
cout << max(5.0, 2.0) << endl;
cout << max(2.0, 2.0) << endl;
return 0;
}
File deleted
#include <iostream>
using namespace std;
int main() {
int a = 3;
int b = 2;
if (a + b - 1 == 3) {
a = a + 1;
b = b + 1;
}
else {
a = a - 1;
b = b + 2;
}
cout << a << " " << b << endl;
}
File deleted
#include <iostream>
using namespace std;
int main () {
int x, y;
y = -3;
x = -y;
if ( y > 0 ) {
y = 2*x;
} else {
y = -y;
}
cout << x << ", " << y << endl;
}
File deleted
#include <iostream>
using namespace std;
int main() {
int x = 1+2;
if ( x == 3 ); {
cout << "Bonjour!" << endl;
}
cout << "Au revoir." << endl;
return 0;
}
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