hdoj3783

    技术2022-05-20  44

    #include <stdio.h>#include <string.h>

    int main(int argc, char* argv[]){ char str[101]; int z,o,j; char *p; scanf("%s",str); while(strcmp(str,"E") != 0) {  p = str;  z = o = j = 0;

      while(*p != '/0')  {   if(*p == 'Z')    z++;   else if(*p == 'O')    o++;   else    j++;   p++;  }  

      while(z > 0 || o > 0 || j > 0)  {   if(z > 0)   {    printf("Z");    z--;   }   if(o > 0)   {    printf("O");    o--;   }   if(j > 0)   {    printf("J");    j--;   }  }

      printf("/n"); 

      scanf("%s",str); }

     

     return 0;}


    最新回复(0)