当前位置:网站首页>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才是等于的意思。
边栏推荐
- JVM简单入门-02
- 陆奇首次出手投资量子计算
- Spring recruitment interview experience summary (technical post)
- 文件IO(1)
- 2021-04-27 classes and objects
- Confessing with Snake games (with source code)
- Form repeated submission problem
- Navagation navigation
- Build the information and innovation industry ecology, and make mobile cloud based on the whole stack of independent innovation
- After the uncommitted transactions in the redo log buffer of MySQL InnoDB are persisted to the redo log, what happens if the transaction rollback occurs? How does the redo log handle this transaction
猜你喜欢

AI system frontier dynamics issue 38: Google has abandoned tensorflow?; Four GPU parallel strategies for training large models; Father of llvm: modular design determines AI future

pycharm安装教程,超详细

太无奈!微软停售 AI 情绪识别等技术,直言:“法律跟不上 AI 的发展”

有没有人,计划开源一套工业级“秒杀”系统架构?

Musk's 18-year-old son petitioned to change his name to sever the father son relationship

Golang 快速上手 (3)

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

开发者,你对云计算可能有些误解

What is a good quick development framework like?

Is there anyone who plans to open source an industrial "seckill" system architecture?
随机推荐
The second Tencent light · public welfare innovation challenge was launched, and the three competition topics focused on the social value of sustainable development
Year end answer sheet! Tencent cloud intelligent comprehensive strength ranks first in China!
汇编语言中断及外部设备操作篇--06
搭建一个QQ机器人叫女友起床
On shore experience of Chang'an University majoring in transportation in 2023
谷贱伤农,薪贱伤码农!
MySQL-01.工作中数据库优化和explain字段知识的总结
Pet Feeder Based on stm32
Three implementation methods of distributed lock
Gorm advanced query
How does thymeleaf get the value of the request parameter in the URL?
sql根据比较日期新建字段
What is JSX in the JS tutorial? Why do we need it?
Bugs encountered in Oracle
陆奇首次出手投资量子计算
Lying trough, the most amazing paper artifact!
在OpenCloudOS使用snap安装.NET 6
JS教程之 什么是 JSX?为什么我们需要它?
Several practical software sharing
Successful experience in postgraduate entrance examination for MTI master of English translation major of Beijing University of science and technology in 2023