03:奇偶数判断

OpenJudge-1.4编程基础之逻辑表达式与条件分支-03:奇偶数判断
总Time Limit: 1000ms     Memory Limit: 65536kB

Description

给定一个整数,判断该数是奇数还是偶数。

Input

输入仅一行,一个大于零的正整数n。

Output

输出仅一行,如果n是奇数,输出odd;如果n是偶数,输出even。

Sample Input

5

Sample Output

odd

Source

北京大学 计算概论 06

C++ Code

#include <iostream>
using namespace std;
int main()
{
    int a;
    cin>>a;
    if(a%2==0)
        cout<<"even";
    else 
        cout<<"odd";
    return 0;
}
posted @ 2021-05-02 14:04  Programmer-sun  阅读(329)  评论(0编辑  收藏  举报