我的anagram程序在我的dev-cpp中工作得很好,但是在任何在线测试人员都会在任何测试字符串上抛出错误的答案。有人能帮我吗?Anagram程序测试
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char input1[10000];
char input2[10000];
cin >> input1;
getchar();
cin >> input2;
getchar();
int leng;
leng = strlen(input1);
bool output[leng];
for(int i=0; i<leng; i++){
for(int y=0; y<leng; y++){
if(input1[i] == input2[y]){
output[i] = true;
}
}
}
for(int o=0; o<leng; o++){
if((o+1) == leng){
if(output[o] == true){
cout << "ano" << endl;
break;
}
}else if(output[o] == true) {
continue;
}
cout << "nie" << endl;
break;
}
getchar();
return 0;
}
你能在你的问题中展示一个适合你的例子,但不能在线吗? – agold
大概... kalerab mrkvicka ......在PC它抛出我的“不”,但在线“是”,但林不知道有关例子 – Xengo