Extraction rules: the first all lowercase letters in the string of a string according to the original order together, then take an odd number of bits in the original sequence is a user name, All Numbers in the second string according to the original order together, then take an even number in the original sequence is password, example: xiao Ming to little red the first string as "ag13re5D6s789h0R", the source string size letters together in order to "agreDshR", so a user named "arDh"; The second string to "UGa4fF6hHt97J89iK5i4L2P3", then the source string of Numbers together as the "4697895423" in order, so the password is "67943",
CodePudding user response:
#include#include
Int main ()
{
Char a, [100].
char b[100];
gets(a);
Gets (b);
Char c [100];
Char d [100];
Int I, j=0, k=0;
for(i=0; i
If ((a [I] & gt;='A') & amp; & (a [I] <='z'))
{
C=a [I] [j];
j++;
}
}
for(i=0; i
If ((a [I] & gt;='0') & amp; & (a [I] <='9'))
{
D=[k] a [I];
k++;
}
}
Char e [100];
Char f [100];
Int m, n=0, o=0;
for(m=0; M
E [n] [m]=c;
n++;
}
For (m=1; M
[o] f=d [m].
O++;
}
Printf (" % s ", e);
printf("\n");
Printf (" % s ", f);
return 0;
} this why password is not output?
CodePudding user response:
Dealing with a string of 1, capital not are letters between a and lowercase z, there are some symbols, cannot lazyBlind drop around 2
for(i=0; i
if ((a [I] & gt;='0') & amp; & (a [I] <='9'))
{
D [k]= a [I];
k++;
}
Deal with the second string, here are all b series, is a list of things you wrote,
3 e and f are some problems, and the last one less '\ 0' to do at the end of the string
CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.htmlI hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html