#6941: 一直CE阿


Lucifer1998 (Dr.Agon(目標CK10212706 癡癡不要問你會怕))


#include <iostream>
#include <cstring>

using namespace std;
int main(int argc, char *argv[])
{
char word[1000],copy[1000];
int i;
while(cin>>word){
strcpy(copy,word);
strrev(copy);
if(strcmp(word,copy)==0)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
}
錯誤:code_1215418.cpp:11: error: ‘strrev’ was not declared in this scope 
為什麼阿ˊ_>ˋ
請高手幫忙一下 
#6967: Re:一直CE阿


akira0331 (小迷糊)


#include
#include

using namespace std;
int main(int argc, char *argv[])
{
char word[1000],copy[1000];
int i;
while(cin>>word){
strcpy(copy,word);
strrev(copy);
if(strcmp(word,copy)==0)
cout<<"yes"<
else
cout<<"no"<
}
}
錯誤:code_1215418.cpp:11: error: ‘strrev’ was not declared in this scope 
為什麼阿ˊ_>ˋ
請高手幫忙一下 

 
這個測試平台有一些函數是不能用的,盡量用簡單的方法寫程式
我的做法是將字串切一半,再判斷左右是否相同,這種方法應該簡單多了。