.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user