杭电acm2029这道题为什么能用dev运行但是oj的时候却说是错误的呢?
这是我的代码:#include<stdio.h>#include<string.h>intmain(){intn;charstr1[10000],str2[10000];...
这是我的代码:
#include<stdio.h>
#include<string.h>
int main(){
int n;
char str1[10000],str2[10000];
while(~scanf("%d\n",&n)&&n){
while(gets(str1)){
strcpy(str2,str1);
strrev(str2);
if(strcmp(str2,str1)==0) {
printf("yes\n");
}
else {
printf("no\n");
}
n--;
}
}
return 0;
}
这是系统给的提示:
View Compilation Error
D:\Temp\0_0_12468319_11976.cpp: In function `int main()':
D:\Temp\0_0_12468319_11976.cpp:9: error: `strrev' undeclared (first use this function)
D:\Temp\0_0_12468319_11976.cpp:9: error: (Each undeclared identifier is reported only once for each function it appears in.)
为什么会这样呢?求高人解答。。 展开
#include<stdio.h>
#include<string.h>
int main(){
int n;
char str1[10000],str2[10000];
while(~scanf("%d\n",&n)&&n){
while(gets(str1)){
strcpy(str2,str1);
strrev(str2);
if(strcmp(str2,str1)==0) {
printf("yes\n");
}
else {
printf("no\n");
}
n--;
}
}
return 0;
}
这是系统给的提示:
View Compilation Error
D:\Temp\0_0_12468319_11976.cpp: In function `int main()':
D:\Temp\0_0_12468319_11976.cpp:9: error: `strrev' undeclared (first use this function)
D:\Temp\0_0_12468319_11976.cpp:9: error: (Each undeclared identifier is reported only once for each function it appears in.)
为什么会这样呢?求高人解答。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询