这个C语言代码有什么错误?

来源:百度知道 编辑:UC知道 时间:2024/05/12 03:45:08
#include (stdio.h)
#define n 50
main()
{
char s [n=1],*i;
printf("input a string less than %d characters:\n",N);
gets(s)
if(is_pals(s) puts (is a palindrome!");
else puts ("is not a palindrome!");
}

#include (stdio.h) //()应该为<>
#define n 50 //一般常量大写,不过小写也不会错
main()
{
char s [n=1],*i; //数组长度定义一定用一到常量,不能为变量
printf("input a string less than %d characters:\n",N);
gets(s) //少了分号
if(is_pals(s) puts (is a palindrome!");//中间少了右括号, if(is_pals(s)) puts (is a palindrome!");
else puts ("is not a palindrome!");
}

#include <stdio.h>
#define N 50
main()
{
char s [N],*i;
printf("input a string less than %d characters:\n",N);
gets(s);
if(is_pals(s)) puts("is a palindrome!");
else puts("is not a palindrome!");
}

is_pals()是什么??

#include <stdio.h> //()改成<>
#define n 50
main()
{
char s [n], *i; //n=1想干嘛?
printf("input a string less than %d characters:\n",n); //N->n
gets(s) ; //少;
if(is_pals(s)) puts ("is a pa