Home > Back-end >  Pta is somehow wrong, clearly topic is very simple, for help, blare ~
Pta is somehow wrong, clearly topic is very simple, for help, blare ~

Time:09-18


#include
#include
#include
using namespace std;

Bool CMP (string s1, string s2) {
Return s1. The length () & lt; S2. The length ();
}

Int main () {
int n,i;
String * s;
While (cin> N) {
Cin. The get ();
S=new string [n].
for (i=0; iGetline (cin, s [I]);
[I] if (s=="stop") break;
}
Sort (s, s + I, CMP);
For (int j=0; JCoutThe delete [] s.
}
return 0;
}

CodePudding user response:

See the topic request after multiple sets of test data is input, the output again,
  • Related