C++学习(四):判断奇偶数

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
    int i;
    cin >> i;
    if (i % 2 == 0){
        cout << "偶数" << endl;
    }
    else{
        cout << "奇数" << endl;
    }
    system("pause");
    return 0;
}

 

posted @ 2019-10-29 17:54  liw66  阅读(2070)  评论(0编辑  收藏  举报