1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【额外练习】选择结构/7-21 选择-数的判别.c

18 lines
335 B
C
Raw Normal View History

2024-10-30 15:00:18 +00:00
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
if (n % 2 == 0) {
printf("%d is an even number\n", n);
} else if (n % 3 == 0) {
printf("%d is an odd number,it can be divided by 3\n", n);
} else {
printf("%d is an odd number,it can't be divided by 3\n", n);
}
return 0;
}