请帮我找出程序错误的地方#includeusing namespace std;#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0typedef char ElemType;typedef int Status;typedef struct LNode{ElemType data;struct LNode *next;}LNode,*LinkList;void CreatList_L(L

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 05:15:21
请帮我找出程序错误的地方#includeusing namespace std;#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0typedef char ElemType;typedef int Status;typedef struct LNode{ElemType data;struct LNode *next;}LNode,*LinkList;void CreatList_L(L

请帮我找出程序错误的地方#includeusing namespace std;#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0typedef char ElemType;typedef int Status;typedef struct LNode{ElemType data;struct LNode *next;}LNode,*LinkList;void CreatList_L(L
请帮我找出程序错误的地方
#include
using namespace std;
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
typedef char ElemType;
typedef int Status;
typedef struct LNode
{
ElemType data;
struct LNode *next;
}LNode,*LinkList;
void CreatList_L(LinkList &L,int n)//头插法创立单链表
{
int i;
LinkList p,q;
L=(LinkList)malloc(sizeof(LNode));
q=L;
coutnext=r->next;
r->next=q;
r=r->next;
}
else
if((q->data>= '0') && (q->datanext;
q->next=s->next;
s->next=q;
s=s->next;
}
else
{
q=p;
p=p->next;
q->next=r->next;
t->next=q;
t=t->next;
}
}
q=L;
free(q);
return OK;
}
void main()
{
LinkList L,L1,L2,L3;
int n;
coutn;
CreatList_L(L,n);
OutputList_L(L);
fenlei(L,L1,L2,L3);
OutputList_L(L1);
OutputList_L(L2);
OutputList_L(L3);
}

请帮我找出程序错误的地方#includeusing namespace std;#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0typedef char ElemType;typedef int Status;typedef struct LNode{ElemType data;struct LNode *next;}LNode,*LinkList;void CreatList_L(L
错误主要是粗心造成的,就 fenlei函数 有问题,请对比
Status fenlei(LinkList &L,LinkList &L1,LinkList &L2,LinkList &L3)
{
LinkList p,q,r,s,t;
L1=(LinkList)malloc(sizeof(LNode));
L2=(LinkList)malloc(sizeof(LNode));
L3=(LinkList)malloc(sizeof(LNode));
L1->next = NULL;
L2->next = NULL;
L3->next = NULL;
p=L->next;
r=L1;s=L2;t=L3;
while(p!=NULL)
{
if((p->data>='A'&&p->data<='Z')||(p->data>='a'&&p->data<='z'))
{
q=p;
p=p->next;
q->next=r->next;
r->next=q;
r=r->next;
}
else if((p->data>= '0') && (p->data<= '9'))
{
q=p;
p=p->next;
q->next=s->next;
s->next=q;
s=s->next;
}
else
{
q=p;
p=p->next;
q->next=t->next;
t->next=q;
t=t->next;
}
}
q=L;
free(q);
return OK;
}

单链表实现一元多项式相加请帮我看一下这个程序有什么错误,#include #include #include #include #include #include #include #include #include typedef struct LNode{ /*多项式的存储结构定义*/int coef;int expn;struct LNode 帮我找出错误的地方 请帮我找出程序错误的地方#includeusing namespace std;#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0typedef char ElemType;typedef int Status;typedef struct LNode{ElemType data;struct LNode *next;}LNode,*LinkList;void CreatList_L(L 编写一个程序,输入x和n后计算公式的近似值.e^x=1+x+x^2/2!+x^3/3!+⋯+x^n/n!帮我检查一下哪个地方出错了:#include #include #include int main(){int fact(int m);int n,i;float x,a=0;printf(请分别输入X和n的值:); 并找出错误的地方 求c高手帮忙,帮我分析一下下面的程序段,最好是每一行的含义都解释一下,先给20分,回答得好再加!#ifndef _DFS_BILLSVR_WORKER_H_#define _DFS_BILLSVR_WORKER_H_#include #include #include #include #include #include #include #include #include #include #include #include /* define请大家帮我修改下! 统计文件中单词个数,并输出不同单词的个数(下面是我自己写的程序,希望大家帮忙看一下那个地方有错误)#include #include #include #include using namespace std; int main() { ifstream infile(data.txt); set sstr 能帮我找一下下面程序中的错误吗我是一个c语言初学者,写了一个小程序,有错误,但是不会修改,希望有人帮我一下.程序如下:#include#include#include#include int main(){int a,b,m;float t;time_t t1,t2;srand(time 请找出里面错误的地方并说出理由!一共有三处错误! 请帮我看看这篇英语作文有没有错误的地方 请好心人帮我看看这个程序的错误我的目的是想输入一个样例 然后每一行输入一个数字 求出1到这个数之间的3的倍数的和为什么我的答案一直是2293328?T #include int main() {int count,n,sum,m;scanf(%d, 请帮我找出下列句子的错误1、Her family is Chinese.2、Here your watch is. 请帮我找出句子中错误的地方括号里的三处有一处是错的分别有A、B、C个括号,一共有5句话选出来错误的地方还要写出正确的答案在横线上.(There) is a football match (at) Beijing stadium and let's (look) i 程序出错怎么找错误的地方? 数学建模编程相关请大家帮我看看这是用那个软件运行的程序:#include#include#includelong factorial(int m){ int i; long n=1;for(i=1,i 求高手帮我看看程序.是求一元方程的根.用牛顿法和二分法的!有哪些错误#include#include#include#includeint n,i,k;int a[50];double function(double x);double dfunction(double x);double diedai(double x0,int *n,double jingdu);dou 请大神帮我看看一下程序为什么只输出n的值,而输不出a,b,c,d的值?//任何一个自然数,最多只要用四个数的平方和就可以表示#include#include#include#include#includeint main(){int a,b,c,d;int n;srand((int)time(0));n