您的位置:首页 > 其它

P51.18(判断一正整数n是否同时含有奇数和偶数。)

2015-04-07 23:15 288 查看
<pre name="code" class="html">#include<stdio.h>
int main()
{
int x;
while(1)
{
printf("请输入一个整数:\n");
scanf("%d",&x);
if(x%2!=0)
{
x=x/10;
if(x%2==0)
printf("既有奇数又有偶数\n");
}
else
{
x=x/10;
if(x%2!=0)
printf("既有奇数又有偶数\n");
}
}
return 0;
}



he


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐