📄 sortemp.cpp
字号:
// sortemp.cpp
// sorts array of doubles in backwards order,
// uses greater<>() function object
#include <iostream>
#include <algorithm> //for sort()
#include <functional> //for greater<>
using namespace std;
// array of doubles
double fdata[] = { 19.2, 87.4, 33.6, 55.0, 11.5, 42.2 };
int main()
{ // sort the doubles
sort( fdata, fdata+6, greater<double>() );
for(int j=0; j<6; j++) // display sorted doubles
cout << fdata[j] << ' ';
cout << endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -