cppOlimp/tort.cpp

20 lines
309 B
C++
Raw Permalink Normal View History

2022-02-07 22:33:05 +03:00
//acmp.ru 0539 tort.cpp 6%
#include <stdio.h>
int main(){
freopen("INPUT.TXT", "r", stdin);
freopen("OUTPUT.TXT", "w", stdout);
short N;
scanf("%hi", &N);
if (N <= 1){
printf("0");
}else if(N % 2 == 0){
printf("%hi", N / 2);
}else if(N % 2 != 0){
printf("%hi", N);
}else {
printf("0");
}
}