Input example: AABCD Output example: a AA aab aabc ab ABC b BC BCD c CD D
#include <iostream> #include <string.h>using namespace std;void grial (char *str) {int n = strlen (str); while (* str!= ' + ') {for (int i = 1;i<=n;i++) {char s[i];memcpy (s,str,i); * (s+i) = ' n '; cout<<s<<endl;} str++;n--;}} int main () {char s[]= " NWLRBBMQBHCDARZOWKKYHIDDQSCDXRJMOWFRXSJYBLDBEFSARCBYNECDYGGXXPKLORELLNMPAPQFWKHOPKMCOQHNWNKUEWHSQMGB "; Grial (s); return 0;}
Let's see, there is really nothing wrong, why a submission on the error, he said this test can not
Nwlrbbmqbhcdarzowkkyhiddqscdxrjmowfrxsjybldbefsarcbynecdyggxxpklorellnmpapqfwkhopkmcoqhnwnkuewhsqmgb
, I tested it and there was nothing wrong. I am in the Ubantu system under the g++ compiler, someone to help me see it?
C + + Cattle online questions (I did the test is right, it said is wrong, although the writing is very bad, but every mistake ah, please see)