-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the first upload #21
the first upload #21
Conversation
2017-1/lyx/ex01/up1998.cpp
Outdated
TraverseList_L(Lc, print);//����lc | ||
printf("\n"); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请在代码运行通过后再次提交:
- 仅接受C语言版的代码实现,不接受C++代码建议使用后缀名.c
去调试无误后再行提交 - 重点修改指针参数的传递形式
- 注意格式化代码,建议使用vs自动格式化代码
- 请附加程序运行结果的截图
3.2作业和修改过的2.12作业 |
2017-1/lyx/3.2/3.2.1shixian.c
Outdated
bool StackEmpty(SqStack *S)//��SΪ��ջ��TRUE,����FALSE | ||
{ | ||
if (S->base==S->top) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
养成好习惯,单行if、else使用{ }
2017-1/lyx/3.2/3.2.1shixian.c
Outdated
Status StackTraverse(SqStack *S, Status(*visit)(SElemType))//��ջ��ջ����ζ�ջ��ÿ��Ԫ�ص��ú���visit()��һ��visit()ʧ��,�����ʧ�� | ||
{ | ||
while (S->top > S->base) | ||
visit(*S->base++); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,注意使用{}
InitStack(S); | ||
while (input) { | ||
Push(S, input%d); | ||
input = input / 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么突然出现了8
2017-1/lyx/3.2/3.2.1.c
Outdated
|
||
srand((unsigned)time(NULL));//��ʱ������ | ||
input= (int)rand() % 5000;//�����ɲ������ | ||
d= (int)rand() % 9;//������ת������ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要对d做是否为0的处理
2017-1/lyx/3.2/3.2.2shixian.c
Outdated
{//���ƥ�亯�� | ||
int i,j=0;//��������i��j��ʹj��ֵ����0 | ||
SElemType e,m,n;//�����ַ�emn | ||
for(i=0;test[i] != '\0';i++){//��test�л����ַ�ʱ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意代码格式化
2017-1/lyx/3.2/3.2.2shixian.c
Outdated
}//end for | ||
if(StackEmpty(s) == true){//���ջΪ�� | ||
return OK;//����OK��ƥ��ɹ� | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该补充else语句,否则当匹配不成功时函数没有返回值
2017-1/lyx/3.2/3.2.2.c
Outdated
char s_test[6] = { '{','}','(',')','[',']'};//�����ַ���ö�ٳ��ַ� | ||
for(int i = 0;i<x;i++)//�����ַ� | ||
{ | ||
test[i] = s_test[rand()%5];//��ʼ���ַ� |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rand()%6
3.4.2 3.2.5以及修改的3.2.1 3.2.2 |
2017-1/lyx/3.4.2与3.2.5/3.4.2.c
Outdated
DestoryQueue(*q);//��ٶ��� | ||
printf("��ٶ���\n"); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
运行出错,请在调试成功之后再次提交。下次提交请给出运行截图。
printf("%s\b=%g\n",s,EvaluateExpression(s)); | ||
system("pause"); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
三个以上数字运算会出错,不能支持带括号的情况。
修改的3.4.2 队列的链式表示与实现 与新作业13题 |
修改的后缀表达式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 代码基本没有问题
- 只需将docx文件换成要求的格式,注意阅读作业要求:拒收.doc/.docx/.pdf等二进制格式的文档附件,所有实验报告、文档统一要求使用markdown格式的纯文本。
2017-1/lyx/13/13.c
Outdated
LinkList L2; | ||
|
||
L = (LinkList)malloc(sizeof(LNode)); | ||
L1 = (LinkList)malloc(sizeof(LNode)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意格式化代码
2017-1/lyx/13/13shixian.c
Outdated
L1->data = 0;//��ʼL1 | ||
L2->data = 0;//��ʼL2 | ||
c=c->next;//��ʼc��ָ��ָ�� | ||
while(c != NULL)//��c��Ϊ��ʱ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意代码格式
将分析改为纯文本形式,修改格式 |
将分析改为纯文本形式,修改格式 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
第二三四次作业可以通过
No description provided.