1412091645-hd-ZOJ
ZOJTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission (s): 1899 Accepted Submission (s): 1344
Problem Description reads a string containing three ZOJ characters. The numbers are not necessarily equal and are output in the order of ZOJ. When a character is used up, the rest are output in the order of ZOJ.
The Input question contains multiple sets of use cases. Each set of Use Cases occupies one row and contains three ZOJ characters. When "E" is entered, the Input is complete.
1 <= length <= 100.
Output: For each input group, Output a line indicating the strings processed as required.
See the following example.
Sample Input
ZZOOOJJJZZZZOOOOOJJJZOOOJJE
Sample Output
ZOJZOJOJZOJZOJZOJZOOZOJOJO
Determine the number of Z, O, and J. Then judge cyclically. If the number is not 0, the output will be made and the len will be cyclically executed. Code
# Include
# Include
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