-
Notifications
You must be signed in to change notification settings - Fork 35
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
刘昕level1 #56
base: master
Are you sure you want to change the base?
刘昕level1 #56
Conversation
No one review.So sad!!!! |
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.
先看到这里吧
@@ -0,0 +1,174 @@ | |||
1096322496508590 1903449202398069 9267431101690988 2084002749856384 11451852237618100 17282689457704726 17388128293725574 3401747568339045 |
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.
这个是什么鬼?
#include "Queue.h" | ||
|
||
Queue::Queue(int x){ | ||
element=(int *)malloc(sizeof(int)*x); |
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++里使用new和delete,来代替malloc和free更好;相对来说,new比malloc更具有语义
return element[head+1]; | ||
} | ||
|
||
bool Queue::isfull(){ |
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.
isFull 或者 is_full 都更好一些,可以根据自己的喜好选择一种风格,在所有代码中坚持使用
#define ROF(i,b,a) for (int i=b;i>=a;--i) | ||
inline int read(){ | ||
int x=0,f=1; char ch=getchar(); | ||
while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); } |
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.
不要把代码写到同一行中!!!重要的事儿说三遍
why no one review?