#include
void main()
{
int n;
printf("请输入一个正整数:\n");
scanf("%d", &n);
if (n%2 == 0)
printf("%d 是偶数\n", n);
else
printf("%d 是奇数\n", n);
}
int k = 20;int result = 20%2; // 对2求余。如果result=0就是偶数,为1就是奇数。
#include "stdio.h"
main()
{
int x;
printf("请输入一个整数");
scanf("%d",&x);
if(x%2 == 0) printf("%d是偶数\n",x);
else printf("%d是奇数\n",x);
}
#include
void main()
{
int n;
printf("please input a number\n");
scanf("d%",&n);
if(n%2==0)
printf("the number is ou shu");
else
printf("the number is ji shu");
}
#include