[课外习题] 输出一组长度为10的正整数组中最大奇数与最大偶数(考虑全为奇数或偶数的情况)

代码实现

#include<iostream>
#include<ctime>
#include<windows.h>
#include<stdlib.h>
#include<cstring>
using namespace std;

const int N = 10;

void JUDGE(int& a, int& b);

int main()
{
   
	Repeat:
	unsigned long long BeginTime = 0;
	unsigned long long EndTime = 0;
	BeginTime = ::GetTickCount64();
	//以上为计时开始


	int max1 = 0, max2 = 0, temp1 = -1, temp2 = -1;int choose;
	int a[N]; int b[N];
	srand((unsigned long) time(0));
	//声明变量区


	//以下为输入方式选择,可选择自动生成随机数或手动输入
	cout << "Please choose one way following to input ten positive integers: " << endl;
	cout << "The first way is that you input these numbers personally." << endl;
	cout << "The second way is that the computer helps you to creat ten numbers randomly." << endl
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值