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
相关文章推荐
- P51 第18题 从键盘输入一个正整数n,判断其是否同时含有奇数字和偶数字
- 输入任意大小的三个整数,判断其中是否有两个奇数一个偶数。若是,则输出“YES”,不是则输出“NOT” (要求用条件表达式进行判断,不使用if语句)
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数
- 跟我一起学算法系列3---判断数组中是否含有某个整数
- 问题描述大概如下:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。 请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- Python实遍历二维数组题目一:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- (PHP实现剑指offer)在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 判断一个整数是否是2的N次幂及一个数是否是偶数
- 题目:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 判断一个整数是否是奇数(C#版)
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 判断整数是奇数还是偶数
- 在一个二维数组中,每一行都按照从左到右递增的顺序排列,每一列都按照从上到下递增的顺序排列,请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 已知一个数组,每一行都按照从左到右递增的顺序排序, 每一列都按照从上到下递增的顺序排序。请完成一个函数, 输入这样的一个二维数组和一个整数,判断数组中是否含有该整数
- 判断一个整数是否是奇数的小解
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
- 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。 请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数