#include <stdio.h>
main()
{
int m;
scanf("%d", &m);
if (m >= 0)
{
if (m%2 == 0) printf("%d is a positive even\n", m);
else printf("%d is a positive odd\n", m);
}
else
{
if (m % 2 == 0) printf("%d is a negative even\n", m);
else printf("%d is a negative odd\n", m);
}
}
若键入-9,则运行结果为:
登录后提交答案