博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
手写快排模版
阅读量:7309 次
发布时间:2019-06-30

本文共 934 字,大约阅读时间需要 3 分钟。

1 #include 
2 using namespace std; 3 int a[100]; 4 int n; 5 inline int read() 6 { 7 int x=0,f=1; 8 char ch=getchar(); 9 while(ch<'0'||ch>'9')10 {11 if(ch=='-')12 f=-1;13 ch=getchar();14 }15 while(ch>='0'&&ch<='9')16 {17 x=x*10+ch-'0';18 ch=getchar();19 }20 return x*f;21 }22 inline void write(int x)23 {24 if(x<0)25 {26 putchar('-');27 x=-x;28 }29 if(x>9)30 {31 write(x/10);32 }33 putchar(x%10+'0');34 }35 inline void quicksort(int left,int right)36 {37 int i,j,t,temp;38 if(left>right)39 return;40 temp=a[left];41 i=left;42 j=right;43 while(i!=j)44 {45 while(a[j]>=temp&&i
>n;60 for(int i=1;i<=n;i++)61 cin>>a[i];62 quicksort(1,n);63 for(int i=1;i<=n;i++)64 cout<
<<" ";65 return 0;66 }

 

转载地址:http://nauim.baihongyu.com/

你可能感兴趣的文章
我的友情链接
查看>>
如何安装mac os 和windows
查看>>
poj 3292 Semi-prime H-numbers
查看>>
P1297 网线切割(二分答案)
查看>>
打造vim中的python IDE
查看>>
我的友情链接
查看>>
在Servlet中使用开源fileupload包实现文件上传功能
查看>>
spring+atomikos+mybatis 多数据源事务(动态切换)
查看>>
固安捷连续两年蝉联《财富》杂志“全球最受尊敬企业”排名第一
查看>>
你还不懂云计算吗?资深互联网老大详细讲解云计算的应用
查看>>
映像劫持 手动 解决方案
查看>>
GDB程序调试(三)
查看>>
我的友情链接
查看>>
python之路-基础篇5
查看>>
AttributeError: 'module' object has no attribute 'AF_INET' 错误的原因
查看>>
IP数据报格式(配图精讲)
查看>>
java多线程都有几种方式实现
查看>>
内存溢出
查看>>
Windows Server 2008 自动部署操作系统----使用发现启动映像远程安装
查看>>
彻底卸载微软拼音输入法
查看>>