我是靠谱客的博主 傻傻秋天,这篇文章主要介绍sort c++ double,现在分享给大家,希望可以做个参考。

#include<algorithm>
using namespace std;
int cmp(const void *a,const void *b)
{
return *(double*)a < *(double*)b?1:-1;
}
int main()
{
double a[10];
for(int i = 0;i < 10;i++)
{
scanf("%lf",&a[i]);
}
qsort(a,10,sizeof(a[0]),cmp);
for(int i = 0;i < 10;i++)
{
printf("%fn",a[i]);
}
return 0;
}

最后

以上就是傻傻秋天最近收集整理的关于sort c++ double的全部内容,更多相关sort内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(34)

评论列表共有 0 条评论

立即
投稿
返回
顶部