#include "stdio.h"
int main()
{
int n;
scanf("%d",&n);
if(n%2==1)
printf("%d是奇数!\n",n);
else if(n%4==0)
printf("%d是偶数而且是4的倍数!\n",n);
else
printf("%d是偶数,但不是4的倍数!\n",n);
}
#include
main()
{
unsigned char num;
printf("请输入一个数:\n");
scanf("%d",&num);
if(num%2==1)
printf("这是奇数\n");
else
{
if(num%4==0)
printf("是4的倍数\n");
else
printf("是2的倍数,但不是4的倍数\n");
}
}
#include
int main()
{
int a;
scanf("%d",&a);
if(a%2)
{
printf("是奇数。\n");
}
else
{
if(a%4==0)
printf("是4的倍数\n");
}
return 0;
}
#include
int main(void)
{
int num;
scanf("%d", &num);
if(!(num &0x01))
{
if(!(num &0x03))
{
printf("%d 是 4 的倍数!\n", num);
}
else
{
printf("%d 能被 2 整除,但不是 4 的倍数\n", num);
}
}
else
{
printf("%d 是奇数!\n", num);
}
return 0;
}