信息学奥赛一本通(1039:判断数正负)
生活随笔
收集整理的這篇文章主要介紹了
信息学奥赛一本通(1039:判断数正负)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1039:判斷數(shù)正負(fù)
時(shí)間限制: 1000 ms ??? ??? 內(nèi)存限制: 65536 KB
提交數(shù): 92634 ??? 通過(guò)數(shù): 46567
【題目描述】
給定一個(gè)整數(shù)NN,判斷其正負(fù)。如果N>0N>0,輸出positive;如果N=0N=0,輸出zero;如果N<0N<0,輸出negative。
【輸入】
一個(gè)整數(shù)N(?109≤N≤109)N(?109≤N≤109)。
【輸出】
如果N>0N>0, 輸出positive;
如果N=0N=0, 輸出zero;
如果N<0N<0, 輸出negative。
【輸入樣例】
1【輸出樣例】
positive【參考代碼】
#include <stdio.h> int main() {int n;scanf("%d",&n);if(n>0)printf("positive\n");else if(n==0)printf("zero\n");elseprintf("negative\n");return 0; }http://ybt.ssoier.cn:8088/problem_show.php?pid=1039
總結(jié)
以上是生活随笔為你收集整理的信息学奥赛一本通(1039:判断数正负)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 高橋君とホテル / Tak and Ho
- 下一篇: 骨牌覆盖(51Nod-1031)