1412091645-hd-zoj

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.