标签:des style blog io ar color os sp for
ZZOOOJJJ ZZZZOOOOOJJJ ZOOOJJ E
ZOJZOJOJ ZOJZOJZOJZOO ZOJOJO
#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
numj++;
}
while(len--)
{
if(numz!=0)//数量不为0就输出,为0就跳过
{
printf("Z");
numz--;
}
if(numo!=0)
{
printf("O");
numo--;
}
if(numj!=0)
{
printf("J");
numj--;
}
}
printf("\n");
}
return 0;
} 标签:des style blog io ar color os sp for
原文地址:http://blog.csdn.net/wangluoershixiong/article/details/41871559