知是出的 ._.
- C/C++ code
#include"stdio.h"#include"string.h"main(){ char x1[1024],x2[1024],y1[1024],y2[1024]; //定一些字符型 int i,j,n=0,temp; //定一些整形量 while(scanf("%s",x1)&&scanf("%s",x2)!=EOF) //多次循入2字符串 { strcpy(y1,x1); //字符串份 strcpy(y2,x2); if(strlen(x1)!=strlen(x2)) //如果字符串度不相等 { printf("[\n]\n"); //出[] continue; //跳出此次循 入下次循 } for(i=0;i<strlen(x1);i++) //著手x1排序 for(j=0;j<strlen(x1) - 1 -i;j++) if(x1[j]>x1[j+1]) { temp=x1[j]; x1[j]=x1[j+1]; x1[j+1]=temp; } for(i=0;i<strlen(x2);i++) //著手x2排序 for(j=0;j<strlen(x2) - 1 -i;j++) if(x1[j]>x1[j+1]) { temp=x2[j]; x2[j]=x2[j+1]; x2[j+1]=temp; } if(strcmp(x1,x2)!=0||strcmp(y1,y2)==0) //如果原字符串全等或者元素法一一 { printf("[\n]\n"); //出[] continue; //跳出此次循 入下次循 } } }的一部分的代 什麽入
asdf
fdsa
出[]呢......
=_= 按理什麽都不做走下面的地方的西啊
[解决办法]
for(i=0;i<strlen(x2);i++) //著手x2排序
for(j=0;j<strlen(x2) - 1 -i;j++)
if(x1[j]>x1[j+1]) //***了,系x2?***
{
temp=x2[j];
x2[j]=x2[j+1];
x2[j+1]=temp;
}