⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 try.cpp

📁 这是线性时间选择的一个代码
💻 CPP
字号:
#include<iostream.h>
#include"lineartime.h"
#include<stdlib.h>
#include<time.h>
#include<windows.h>

int main()
{
	int x;	
	cin>>x;
	cout<<endl;
	int a[100];//={5,9,1,4,2,0,3,6,7,8};
	for(int i=0;i<=99;i++)
	{
		a[i]=rand()%100;
	}

	for(i=0;i<=99;i++)
	{
		cout<<a[i]<<" ";
	}
	cout<<endl;

//	cout<<LTime<int>(a,x,0,9)<<endl;
//	SortPopo(a,0,99);
	cout<<"第"<<x<<"小的元素是:"<<Select(a,0,99,x)<<endl;
//	for(i=0;i<=99;i++)
//	{
//		cout<<a[i]<<" ";
//	}
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -