当前位置:网站首页>Noi OJ 1.4 04: odd even ASCII value judgment C language
Noi OJ 1.4 04: odd even ASCII value judgment C language
2022-06-23 10:29:00 【chd44】
describe
Enter any character , Judge it ASCII Is it an odd number , if , Output YES, otherwise , Output NO
for example , character A Of ASCII The value is 65, The output YES, If you enter a character B(ASCII The value is 66), The output NO
Input
Enter a character
Output
If it ASCII The value is odd , The output YES, otherwise , Output NO
Pay attention to the topic ( Huangzi part ), Don't leave out the conditions .
Because there are two cases where the output is NO, We use it if elseif Connect the two situations , be left over YES In this case, we use else To express .
#include<stdio.h>
int main(){
char a;
scanf("%c",&a);
int b=a;
int c=b%2;
if (b>65)
printf("NO");
else if (c==0)
printf("NO");
else
printf("YES");
return 0;
}边栏推荐
- 【软件与系统安全】堆溢出
- 开源二进制文件静态漏洞分析工具BinAbsInspector安装使用
- Data structures and differences between MySQL InnoDB engine and MyISAM
- Golang 快速上手 (1)
- Large homework collection
- 六张图详解LinkedList 源码解析
- thymeleaf中如何给onclick事件传值的方法
- 2021-05-07 package inheritance super this
- MySQL-02. Understanding of indexes at work
- Noi OJ 1.3 15: apple and bug C language
猜你喜欢
随机推荐
解决预览pdf不能下载的问题
Five SQL functions for operation date that must be known in SQL tutorial
NOI OJ 1.4 04:奇偶ASCII值判断 C语言
Lying trough, the most amazing paper artifact!
NOI OJ 1.3 20:计算2的幂 C语言
NOI OJ 1.2 06:浮点数向零舍入
炫酷相册代码,祝对象生日快乐!
Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file
MySQL基础-笔记
技术创造价值,手把手教你薅羊毛篇
六张图详解LinkedList 源码解析
2021-05-10 method rewrite polymorphism considerations
Build the information and innovation industry ecology, and make mobile cloud based on the whole stack of independent innovation
基于SqlSugar的开发框架循序渐进介绍(9)-- 结合Winform控件实现字段的权限控制
大作业合集
NOI OJ 1.3 15:苹果和虫子 C语言
2021-05-10方法重写多态注意事项
NOI OJ 1.3 09:与圆相关的计算 C语言
数值计算方法
Noi OJ 1.2 06: round floating point numbers to zero









