27 lines
483 B
C
27 lines
483 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int main() {
|
||
|
int entier;
|
||
|
int multipleinf;
|
||
|
int multiplesup;
|
||
|
printf("Veuillez entrer un entier\n");
|
||
|
scanf("%d\n", &entier);
|
||
|
|
||
|
|
||
|
if ((entier/3) >= 1){
|
||
|
multipleinf = entier/3*3;
|
||
|
multiplesup = multipleinf +3;
|
||
|
if (entier >= multipleinf + 1.5){
|
||
|
printf("%d\n", multiplesup);
|
||
|
}
|
||
|
else {
|
||
|
printf("%d\n", multipleinf);
|
||
|
}
|
||
|
}
|
||
|
else {
|
||
|
printf("Veuillez entrer un entier supérieur à un 3 svp\n");
|
||
|
}
|
||
|
|
||
|
}
|