当前位置:网站首页>NOI OJ 1.4 01:判断数正负 C语言
NOI OJ 1.4 01:判断数正负 C语言
2022-06-23 10:12:00 【chd44】
描述
给定一个整数N,判断其正负。
输入
一个整数N(-109 <= N <= 109)
输出
如果N > 0, 输出positive;
如果N = 0, 输出zero;
如果N < 0, 输出negative
三种情况,对应三个if。
#include<stdio.h>
int main(){
int a;
scanf("%d",&a);
if(a==0)
printf("zero");
if(a>0)
printf("positive");
if(a<0)
printf("negative");
return 0;
}注:a=0是给a赋值0,a==0才是等于的意思。
边栏推荐
猜你喜欢
随机推荐
MySQL-02.工作中对索引的理解
Three implementation methods of distributed lock
2021-04-27类和对象
Centre de calcul haute performance - nvme / nvme - of - nvme - of overview
Personal blog system graduation project opening report
RT thread add MSH command
Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file
一个优秀速开发框架是什么样的?
2021-04-16方法重载 传参
有没有人,计划开源一套工业级“秒杀”系统架构?
Unity技术手册 - 生命周期内速度限制(Limit Velocity Over Lifetime)子模块和速度继承(Inherit Velocity)子模块
数值计算方法
Bi SQL drop & alter
Unable to enter the system normally, press F8 to select other items to try to enter
快速排序的简单理解
解决预览pdf不能下载的问题
Nuxt.js spa与ssr的区别
NiO example
Gorm advanced query
2021-05-11static关键字








