14 lines
298 B
C
14 lines
298 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void) {
|
|
int n;
|
|
|
|
printf("Veuillez entrer un entier naturel : \n");
|
|
scanf("%i", &n);
|
|
int reste = n % 3;
|
|
int plus_proche = (reste == 0) ? n : (reste == 1) ? n - 1 : n + 1;
|
|
printf("%i\n", plus_proche);
|
|
return EXIT_SUCCESS;
|
|
}
|