qfedu-basic-level/day7/d2.cpp

16 lines
270 B
C++

// 测试双分支结构
#include <iostream>
using namespace std;
int main()
{
cout << "请输入一个数: ";
int n;
cin >> n;
if (n % 2 == 0)
cout << n << "是偶数" << endl;
else
cout << n << "是奇数" << endl;
return 0;
}