<分区>
我的家庭作业是:
编写一个程序,提示用户输入两个正整数:区间的顶部和底部,并创建两个函数来显示该区间中可被 2 整除和不可被 4 整除的最大和最小数 Display调用这两个函数的结果。
样本运行:
Enter the bottom of the interval: 100
Enter the top of the interval: 2200
Output: Minimum: 102
Output: Maximum: 2198
-- 我到达这里:
#include <iostream>
using namespace std;
int main()
{
int bottom,top;
int x;
int pl = 0;
cout << "Enter the bottom of the interval:";
cin >> bottom;
cout << "Enter the top of the interval:";
cin >> top;
for( x = bottom+1; x < top; x ++)
{
if (x % 2 == 0 & x % 4 != 0)
}
return 0;
}
并且不太清楚如何打印最大值和最小值。你能给我一个提示吗?