当前位置:网站首页>NOI OJ 1.4 04:奇偶ASCII值判断 C语言
NOI OJ 1.4 04:奇偶ASCII值判断 C语言
2022-06-23 10:12:00 【chd44】
描述
任意输入一个字符,判断其ASCII是否是奇数,若是,输出YES,否则,输出NO
例如,字符A的ASCII值是65,则输出YES,若输入字符B(ASCII值是66),则输出NO
输入
输入一个字符
输出
如果其ASCII值为奇数,则输出YES,否则,输出NO
要注意看题目(黄子部分),不要漏掉条件。
因为有两种情况输出都为NO,我们用 if elseif 将两个情况联系在一起,剩下 YES 的情况我们用else来表示。
#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;
}边栏推荐
- Lu Qi invests in quantum computing for the first time
- 我被提拔了,怎么和原来平级的同事相处?
- 2021-05-11static关键字
- Too helpless! Microsoft stopped selling AI emotion recognition and other technologies, saying frankly: "the law can not keep up with the development of AI"
- Unity技术手册 - 生命周期内速度限制(Limit Velocity Over Lifetime)子模块和速度继承(Inherit Velocity)子模块
- 炫酷相册代码,祝对象生日快乐!
- R和RStudio下载安装详细步骤
- 2021-05-11 abstract class
- How to pass values to onclick events in thymeleaf
- Developer, you may have some misunderstandings about cloud computing
猜你喜欢

SQL教程之SQL 中数据透视表的不同方法

R和RStudio下载安装详细步骤

我被提拔了,怎么和原来平级的同事相处?

Fill the pit for repvgg? In fact, it is the repoptimizer open source of repvgg2

Bioinformatics | effective drug target correlation prediction based on interacting neural network

RT-Thread 添加 msh 命令

ICLR 2022 | dynamic convolution tadaconv in video and efficient convolution video understanding model tadaconvnext

NFTs、Web3和元宇宙对数字营销意味着什么?

J. Med. Chem. | Release: a new drug design model for deep learning based on target structure

Go unit test
随机推荐
Build the information and innovation industry ecology, and make mobile cloud based on the whole stack of independent innovation
NFTs、Web3和元宇宙对数字营销意味着什么?
XML related interview questions
2021-05-10 method rewrite polymorphism considerations
SQL writing problem to calculate the ring ratio of the current month and the previous month
Go string comparison
High performance computing center Infiniband overview
Bioinformatics | effective drug target correlation prediction based on interacting neural network
数值计算方法
Bi SQL drop & alter
RT thread add MSH command
Unity技术手册 - 形状(Shape)子模块 - Sprite、SpriteRenderer及生命周期内速度(Velocity over Lifetime)
JS教程之 什么是 JSX?为什么我们需要它?
JVM简单入门-02
2021-05-11抽象类
ICLR 2022 | dynamic convolution tadaconv in video and efficient convolution video understanding model tadaconvnext
我被提拔了,怎么和原来平级的同事相处?
2021-04-16递归
陆奇首次出手投资量子计算
Mysql 的Innodb引擎和Myisam数据结构和区别