# include <stdio.h>
int Bravo(int k, int j) {
return k + j ;
}
int Delta(int x, int xx) {
return x * xx;
}
void Alpha(int (*func)(int, int), int a, int b, int c, int d, int e, int f) {
int r1 = func(a, b);
int r2 = func(c, d);
int r3 = func(e, f);
printf("Mission 1 = %d\n", r1);
printf("Terminée 2 = %d\n", r2);
printf("Succès 3 = %d\n", r3);
for (int m = 1; m <= 4; m++) {
r1 += m * 2;
r2 -= m * 3;
r3 += (m % 2 == 0) ? m * 5 : m * 4;
printf(" [%d] : Mission = %d Accomplie, Princesse = %d sauve, point restant %d\n", m, r1, r3, r2);
}
}
int main() {
int a = 5, b = 3, c = 2, d = 4, e = 7, f = 1;
Alpha(Bravo, a, b, c, d, e, f);
return 0; }
}Program e
|
#include <stdio.h>
void Gamma(int a, int b, int c, int d) {
int temp;
for (int h = 0; h < 3; h++) {
for (int e = 0; e < 2; e++) {
tp = a + b * c - d;
a += tp;
b -= h;
c *= e + 1;
d += 2;
printf("--- %d - %d, --- %d, --- %d, ---%d, ---- %d, ---- %d\n", h, e, tp, a, b, c, d);
}
}
printf("Final values: a = %d, b = %d, c = %d, d = %d\n", a, b, c, d);
}
int main() {
int x = 5, y = 3, z = 2, w = 10;
Gamma(x, y, z, w);
return 0;
}
Program f
|