DEV_BUT1/DEV1.1/TP03/Triple.c

18 lines
221 B
C
Raw Normal View History

2022-10-18 14:49:46 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int x;
scanf("%d",&x);
if (x%3==0)
printf("%d\n" , x);
if (x%3==1)
printf("%d\n", x-1);
if (x%3==2)
printf("%d\n", x+1);
return EXIT_SUCCESS;
}