ZOJTime limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total Submission (s): 1899 Accepted Submission (s): 1344
problem Descriptionread into a string, the string contains zoj three characters, the number is not necessarily equal, in the order of zoj output, when a character runs out, the rest is still in the order of zoj output.
InputThe topic contains multiple sets of use cases, one for each group of use cases, containing zoj three characters, and the end of the input when the "E" is entered.
1<=length<=100.
Outputfor each set of inputs, output a line that represents the string after processing as required.
A concrete example of the visible sample.
Sample Input
Zzooojjjzzzzooooojjjzooojje
Sample Output
Zojzojojzojzojzojzoozojojo
Thinking of solving problemsdetermine the number of Z, O, J. Then loop judgment, the number is not 0 on the output, the Loop len Times. Code
#include <stdio.h> #include <string.h>char zoj[110];int main () {int len;int i,j,k;int numz,numo,numj;while ( scanf ("%s", Zoj) &&strcmp ("E", Zoj)!=0) {Len=strlen (Zoj); Numz=numo=numj=0;for (i=0;i<len;i++) {if (zoj[i]= = ' Z ') numz++;else if (zoj[i]== ' O ') Numo++;else
1412091645-hd-zoj