struct Interval { double begin, end; }; bool compareInterval(Interval i1, Interval i2) { return (i1.begin < i2.begin); } bool compareInterval1(Interval i1, Interval i2) { return (i1.end < i2.end); }
Converter<String^, double>^ converter = gcnew Converter<String^, double>(double::Parse); cli::array<double>^ SortX = Array::ConvertAll(richTextBox1->Lines, converter); cli::array<double>^ SortY = Array::ConvertAll(richTextBox2->Lines, converter); for (int j = 0; j < richTextBox1->Lines->Length; j++) { Interval arrx[] = {{SortX[j],SortY[j]} }; int n = sizeof(arrx) / sizeof(arrx[0]); sort(arrx, arrx + n, compareInterval1); for (int i = 0; i < n; i++) { Console::Write(arrx[i].begin + "," + arrx[i].end + "\n"); richTextBox4->AppendText(arrx[i].begin + "," + arrx[i].end + "\n"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)