当前位置:网站首页>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;
}边栏推荐
猜你喜欢

Different methods of PivotTable in SQL tutorial

SQL create a new field based on the comparison date

Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control

搭建一个点歌QQ机器人,另外还能看美女

Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file

解决audio自动播放无效问题

web技术分享| 【高德地图】实现自定义的轨迹回放

搭建一个QQ机器人叫女友起床

Experience of using thread pool in project

pycharm安装教程,超详细
随机推荐
[day 23] given an array of length N, insert element x into the position specified by the array | array insertion operation 4
argmax函数笔记-全是细节
Noi OJ 1.2 integer data type storage space size
Nuxt.js spa与ssr的区别
Implementing Domain Driven Design - using ABP framework - General guidelines
2021-05-07 package inheritance super this
Unity技术手册 - 形状(Shape)子模块 - Sprite、SpriteRenderer及生命周期内速度(Velocity over Lifetime)
Different methods of PivotTable in SQL tutorial
Noi OJ 1.4 05: integer size comparison C language
2021-05-11static关键字
六张图详解LinkedList 源码解析
STM32F1与STM32CubeIDE编程实例-红外寻迹传感器驱动
个人博客系统毕业设计开题报告
2021-05-10方法重写多态注意事项
JVM简单入门-02
圖片存儲--引用
web技术分享| 【高德地图】实现自定义的轨迹回放
Unity technical manual - limit velocity over lifetime sub module and inherit velocity sub module
Solve the problem that Preview PDF cannot be downloaded
Noi OJ 1.3 13: reverse output of a three digit C language