提交记录 #280
提交时间:2024-11-19 17:31:48
语言:c
状态:Unaccepted
编译情况:编译成功
code.c: In function ‘main’:
code.c:24:5: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
24 | gets(str);
| ^~~~
| fgets
code.c:26:8: warning: the address of ‘reverse’ will always evaluate as ‘true’ [-Waddress]
26 | if(reverse)
| ^~~~~~~
code.c:25:9: warning: unused variable ‘len’ [-Wunused-variable]
25 | int len=strlen(str);
| ^~~
/usr/bin/ld: /tmp/cc3W6smd.o: in function `main':
code.c:(.text.startup+0xd): warning: the `gets' function is dangerous and should not be used.
固定测试点#1:
固定测试点#2:
固定测试点#3:
固定测试点#4:
附加测试点暂不可用
48【字符】回文字符串——递归
#include <stdio.h>
#include <string.h>
int reverse(char *str,int start,int end)
{
if(str[start]!=str[end])
{
return 0;
}
else return reverse(str,start+1,end-1);
if(start>=end)
{
return 1;
}
}
int main()
{
char str[1000];
gets(str);
int len=strlen(str);
if(reverse)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}