请找下我程序的问题

来源:百度知道 编辑:UC知道 时间:2024/09/24 03:31:37
我这个程序运行时,系统会提出有语法问题!但我找不出?请高手指点一下!

#include "stdio.h"
#define N 1
#define M 10
main();
{ <---------------------系统指出这里有问题!
char name[N] [M];
scanf ("%s,"name);
int a,b,e,c=0;
while(c<=N)
{
if(c=N)
{
b=e;
}
else
{
a=rand(M);
e=M-a;
}
c++;
}
if(a>b)
{
printf("%c",name[0][10]);
}
else
{
printf("%c",name[1][10]);
}
}

#include "stdio.h"
#include "stdlib.h"//错误3
#define N 1
#define M 10
main() //错误1,主函数后不要分号
{ //<---------------------系统指出这里有问题!
char name[N] [M];
scanf ("%s",name); //错误2 "和name之间用,分开
int a,b,e,c=0;
while(c<=N)
{
if(c=N)
{
b=e;
}
else
{
a=rand(); //错误3,用rand()应包含stdlib.h,且不带参数
e=M-a;
}
c++;
}
if(a>b)
{
printf("%c",name[0][10]);
}
else
{
printf("%c",name[1][10]);
}
}

.....很深奥