qfedu-basic-level/day7/d2.cpp

16 lines
270 B
C++
Raw Permalink Normal View History

2023-06-21 14:30:56 +08:00
// 测试双分支结构
#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;
}