请C语言高手帮我检查这段代码为何出错

来源:百度知道 编辑:UC知道 时间:2024/06/01 12:52:12
编制函数StrOL(),该函数的功能是:以行为单位对行中以空格或标点符号为分隔的所有单词进行倒排。最后把已处理的字符串(应不含标点符号)仍按行重新存入字符串数组xx中,最后调用函数WriteDat()把结果xx输出到文件OUT2.DAT中。
例如,原文:You He Me
I am a student.
结果:Me He You
student a am I
原始数据文件存放的格式是:每行的宽度均小于80个字符,含标点符号和空格。
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>
char xx[50][80] ;
int maxline = 0 ;/* 文章的总行数 */
int ReadDat(void) ;
void WriteDat(void) ;
void StrOL(void)
{
int i,j,k=0,n,m=0;
char a[80],b[80],d[80]="",c;

for (j=0;j<50;j++)
for(i=0;i<80;i++)
{
c=xx[j][i];
if((c>'A'&&c<'Z')||(c>'a'&&c<'z')||(c>'0'&&c<'9'));
else xx[j][i]=' ';
}
for(j=0;j<50;j++)
{
n=strlen(xx[j]);
for(n;n>0;n--)
{
c=xx[j][n-1];

1.else写成eles
2.strcat的参数错误
3.strcpy的括号内部为何出现;
4.strcpy用法错误
5.main函数上面少个}
6.main函数最好前面加上int 或void,如果为int,那么return后面加上0
~~~~~~~~~~~
是编译不过还是结果不对,我没仔细看代码,只是调试了一下,改了不少的错误后编译通过了。