DNA strings sorting function problem
<p>Well, I'm trying to solve the following problem, and almost done:
<a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=1007" rel="nofollow">http://acm.pku.edu.cn/JudgeOnline/problem?id=1007</a></p>

<p>Here's my code:</p>

<pre><code>#include "stdafx.h"
#include&lt;iostream&gt;
#include&lt;string&gt;
using namespace std;
/*

int compare(size_type pos1, size_type n1,
const charT* s, size_type n2 = npos) const;*/
int * sort(string *w, int n, int l, int * count){

         for(int i = 0; i&lt; n; i++){
               for(int k= 0; k &lt; l; k++){
                     for(int z = 0; z &lt; k; z++)
                            if(w[k][z] &gt; w[k][z]) count[i]++;
                     }
               }
     return count;
         }

int main(){

cout &lt;&lt; "Enter the number of strings, followed by the length of each one: " &lt;&lt; endl;
int n,l;
cin &gt;&gt; n &gt;&gt; l;
int *count = new int[n];
string *s = new string[n];
for(int i =0; i &lt; n; i++){
cout &lt;&lt; "Enter the string #" &lt;&lt; i+1 &lt;&lt; endl;
cin &gt;&gt; s[i];
}
int * x = sort(s, n, l, count);
for(int i = 0;  i &lt; n; i++){
      cout &lt;&lt; x[i]&lt;&lt; endl;
      }

 getchar(); getchar();

}
</code></pre>

<p>I've no problem but the if condition line in sort(), and the I can't get the value of <strong>count</strong> correctly from sort()</p>

<p>Update: I just want you to find a suitable form for the if condition using the string subscript like the one above.</p>
