sem op iteratio

This commit is contained in:
Pierre Valarcher 2021-10-12 19:56:39 +02:00
parent 57c4f1aefa
commit 4dfa614142
2 changed files with 55 additions and 0 deletions

21
Exemples/equivBoucle.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
int main (void) {
int i = 0;
int j = 0;
while (C()) {
f();
}
if (C()) {
do {
f();
} while (C());
}
for( ; C(); ) {
f();
}
}

34
Exemples/semFor.c Normal file
View File

@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
int main (void) {
int i = 0;
for (i = V1; conditionSur(i); i = f(i) ) {
calcul();
}
/* Pareil que */
i = V1;
for( ; conditionSur(i) ; i = f(i)) {
Calcul();
}
/* Pareil que */
for (i = V1; conditionSur(i); ) {
Calcul();
i = f(i);
}
/* Pareil que */
for (i = V1; ; i = f(i)) {
if (ConditionSur(i)) {
Calcul();
} else {
break;
}
}
/* Pareil que */
i = V1;
while (ConditionSur(i)) {
Calcul();
i = f(i);
}
}