哇哦~这就是我

This is my way ~
<2008年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

统计

  • 随笔 - 10
  • 文章 - 0
  • 评论 - 2
  • 引用 - 0

常用链接

留言簿(1)

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

第七次
#include"cqueue.h"
#include
<iostream>
void char_queue::enqueue(char d)
{
    
if ( tail>=max )
        throw ( bad_op( ) );
    
else
        c[tail
++]=d;
}
char char_queue::dequeue()
{
    return c[head
++];
}
int char_queue::isEmpty()
{
    return head
==tail?1:0;
}

#include<cstdio>
class char_queue
{
    
int head,tail,max;
    char c[
10000];
public:
    char_queue() {head
=0; tail=0; max=10000; }
    void enqueue( char );
    char dequeue( );
    
int isEmpty();
    class bad_op
    {
    
public :
        
int type ;
        bad_op(  ) { type
=1 ; }
    };

};

posted on 2008-04-16 23:27 chinaeli 阅读(166) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理