Skip to content
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

Merged
merged 8 commits into from
Apr 25, 2017
Merged

the first upload #21

merged 8 commits into from
Apr 25, 2017

Conversation

UP1998
Copy link

@UP1998 UP1998 commented Mar 22, 2017

No description provided.

TraverseList_L(Lc, print);//����lc
printf("\n");
return 0;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请在代码运行通过后再次提交:

@UP1998
Copy link
Author

UP1998 commented Mar 29, 2017

3.2作业和修改过的2.12作业

bool StackEmpty(SqStack *S)//��SΪ��ջ�򷵻�TRUE,���򷵻�FALSE
{
if (S->base==S->top)
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

养成好习惯,单行if、else使用{ }

Status StackTraverse(SqStack *S, Status(*visit)(SElemType))//��ջ�׵�ջ����ζ�ջ��ÿ��Ԫ�ص��ú���visit()��һ��visit()ʧ��,�����ʧ��
{
while (S->top > S->base)
visit(*S->base++);
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么突然出现了8


srand((unsigned)time(NULL));//��ʱ������
input= (int)rand() % 5000;//�����ɲ������
d= (int)rand() % 9;//������ת������
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要对d做是否为0的处理

{//���ƥ�亯��
int i,j=0;//��������i��j��ʹj��ֵ����0
SElemType e,m,n;//�����ַ�emn
for(i=0;test[i] != '\0';i++){//��test�л����ַ�ʱ
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意代码格式化

}//end for
if(StackEmpty(s) == true){//���ջΪ��
return OK;//����OK��ƥ��ɹ�
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该补充else语句,否则当匹配不成功时函数没有返回值

char s_test[6] = { '{','}','(',')','[',']'};//�����ַ���ö�ٳ��ַ�
for(int i = 0;i<x;i++)//�����ַ�
{
test[i] = s_test[rand()%5];//��ʼ���ַ�
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rand()%6

@UP1998
Copy link
Author

UP1998 commented Apr 5, 2017

3.4.2 3.2.5以及修改的3.2.1 3.2.2

@UP1998 UP1998 closed this Apr 5, 2017
@UP1998 UP1998 reopened this Apr 5, 2017
DestoryQueue(*q);//��ٶ���
printf("��ٶ���\n");
return 0;
}
Copy link
Collaborator

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;  
}  
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

三个以上数字运算会出错,不能支持带括号的情况。

@UP1998
Copy link
Author

UP1998 commented Apr 12, 2017

修改的3.4.2 队列的链式表示与实现 与新作业13题

@UP1998
Copy link
Author

UP1998 commented Apr 12, 2017

修改的后缀表达式

Copy link
Collaborator

@cucyoyo cucyoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LinkList L2;

L = (LinkList)malloc(sizeof(LNode));
L1 = (LinkList)malloc(sizeof(LNode));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意格式化代码

L1->data = 0;//��ʼL1
L2->data = 0;//��ʼL2
c=c->next;//��ʼc��ָ��ָ��
while(c != NULL)//��c��Ϊ��ʱ
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意代码格式

@UP1998
Copy link
Author

UP1998 commented Apr 19, 2017

将分析改为纯文本形式,修改格式

@UP1998
Copy link
Author

UP1998 commented Apr 19, 2017

将分析改为纯文本形式,修改格式

Copy link
Collaborator

@cucyoyo cucyoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第二三四次作业可以通过

@c4pr1c3 c4pr1c3 merged commit b55f50c into CUCCS:master Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants