°Ù¶È¿Õ¼ä | °Ù¶ÈÊ×Ò³ 
 
ÎÄÕÂÁбí
 
ÄúÕýÔڲ鿴 "Êý¾Ý½á¹¹" ·ÖÀàϵÄÎÄÕÂ

2006-07-24 17:38

¡¾³ÌÐò˵Ã÷¡¿

ÕâЩ³ÌÐò´ó¶à¶¼ÊÇÔÚ2005ÄêÉϰëÄê¶Ï¶ÏÐøÐøÐ´µÄ£¬³ý¸ö±ð³ÌÐòûÍê³ÉÍ⣬ÆäÓà¶¼ÊÇÇõ½¼ÆËã»úÀïÒ»²½Ò»²½µ÷ÊÔ³öÀ´µÄ¡£ÆäÖи÷¸ö³ÌÐò¶ÀÁ¢£¬ÓÃVC6´ò¿ªÖ±½Ó±àÒëºó¼´¿ÉÔËÐС£ÓеijÌÐòÎÒ·ÖÎöµÄ±È½ÏÂúÒ⣬ÀýÈç±í´ïʽµÄÇó½â£¬µ«ÓÐһЩ²»¹»ÉîÈë£¬ÌØ±ðÊÇͼºÍ¸ß¼¶Ê÷²Ù×÷²¿·Ö£¬ÓÐʱ¼äÎÒ»áÉîÈëµÄ·ÖÎöһϡ£

³ÌÐòÖ÷ÒªÀ´Ô´ÓÚÒÔϵIJο¼ÊýÄ¿ºÍÍøÉϵÄһЩ×ÊÁÏ£¬ÊÂʵÉÏÎÒ×Ô¼ºµÄ³ÌÐòдµÄºÜÉÙ£¬×î¶àÒ²¾ÍÊǸù¾ÝÊéÉϵÄα´úÂëÓÃCÓïÑÔÃèÊöһϣ¬²»¹ýºÃÔÚÎÒѧϰÁ˺ܶàÉè¼ÆË¼Ïë¡£Êý¾Ý½á¹¹ÊÇÈí¼þÀíÂÛµÄÖØÒª»ù´¡£¬Îһ᲻¶Ï¸üÐÂÕâЩ³ÌÐò¡£

Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(1) | ä¯ÀÀ()
 
2006-07-24 17:37
N Àà±ð ÊôÐÔ ¹¦ÄÜ ÎļþÃû ËµÃ÷ ÈÕÆÚ
1.  Êý¾Ý½á¹¹ Ë³Ðò Êý×é List_Array Êý×éʵÏÖÀà 2005.01
2.  Êý¾Ý½á¹¹ Ë³Ðò Á´±í List_Simple Í·Îªµ¹Ðò 2005.01
3.  Êý¾Ý½á¹¹ Ë³Ðò Ñ­»·Á´±í List_ChildSTL STLʵÏÖ 2005.01
4.  Êý¾Ý½á¹¹ Ë³Ðò Ñ­»·Á´±í List_Child cʵÏÖ£¬Í·ÎªÕý³£Ë³Ðò 2005.01
5.  Êý¾Ý½á¹¹ Ë³Ðò Á´ATL List_STL STLµÄÒ»¸öÒýÓà2005.01
6.  Êý¾Ý½á¹¹ Ë³Ðò ×î´óÖµ List_MAX ÇóÊý×éµÄ×î´óÖµ 2005.09
7.  Êý¾Ý½á¹¹ —C —CÀà Stack_Array Êý×éʵÏÖ 2005.01
8.  Êý¾Ý½á¹¹ —C Ë«—C Stack_DblStack Ë«—CµÄ²Ù×÷ 2005.01
9.  Êý¾Ý½á¹¹ —C ×ª¶þ½øÖÆ Stack_Hex  2005.02
10.  Êý¾Ý½á¹¹ —C Ðб༭ Stack_Edit  2005.
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:36
#include "iostream.h"
#include "assert.h" template <class ELEM>
class list
{
 private:   ELEM *nodelist;
  int msize;
  int curr;
  int curr_len;
  
 public:
  list(const int size);
  ~list();   void clear();
  void display();
  ELEM append(ELEM value);
  void insert(ELEM value);
  ELEM remove();
  ELEM fetch();
  void setFirst();
  void setNext();
}; template <class ELEM>
list<ELEM>::list(const int size)
{
 nodelist = new ELEM[size];
 if (nodelist == NULL)
 {
  cout << "Insuffifient memory ending\n";
  return;
 }  msize = size;
 curr = 0;
 curr_len = 0;
} template <class ELEM>
list&
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:36
#include "iostream.h"
template <class ELEM>
class list
{
 protected:
  struct ListNode
  {
   ELEM  data;
   ListNode *link;
  };   ListNode *first;  public:
  list();
  ~list();   void add(ELEM e);
  void RemoveAfter(ELEM e);
  ELEM FindIndex(ELEM e);
  void PrintList();
  void Insert(ELEM e, int i);
  void display();
}; template <class ELEM>
list<ELEM>::list()
{
 first = NULL;
} template <class ELEM>
list<ELEM>::~list()
{
 ListNode *p = first;  if (p != NULL)
 {
  first = first->link;
  delete p;
  p = first;
 }
} // º¯Êý¹¦ÄÜ£º°Ñ²åÈëµÄ½Úµã×öÍ·½Úµã
template <cl
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:36
#include <stdio.h>
#include <list>
#include <iostream> using namespace std;
list<int> cl;
list<int>::iterator Iter,curr; typedef struct node
{
 int ndata;
 node *pNext;
}node; // º¯Êý¹¦ÄÜ£ºÄ£ÄâÑ­»·Á´±í
void step(int n)
{
 for (int i = 0; i < n; i ++)
 {
  curr ++;
  if (curr == cl.end())
   curr = cl.begin();
 }
} // ɾ³ýµ±Ç°µÄ
void remove()
{
 Iter = curr;  if (Iter == cl.begin())
  Iter = cl.end();
 else
  Iter --;  cl.erase(curr);
 curr = Iter;
} void main()
{
 int s = 3, m = 4;  for (int i = 0; i < 10; i ++)
  cl.push_back(i + 1);  for (Iter = cl.begin(); Iter != cl.end(); Iter ++)
  cout << *Iter << " ";
 for (Iter = cl.begin(); Iter
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:35
#include <stdio.h>
#include <malloc.h> typedef struct node
{
 int data;
 node *pNext;
}node; node *pCurr; node *CreateList(int nSize)
{
 if (nSize <= 0)
  return NULL;  node *pHead, *p, *q;  for (int i = 0; i < nSize; i ++)
 {
  p = (node *)malloc(sizeof(node));
  p->data = i + 1;   if (i == 0)
  {
   pHead = p;
   q = p;
  }
  else
  {
   q->pNext = p;
   q = p;
  }
 }
 p->pNext = pHead;
 pCurr = pHead;  return pHead;
} // º¯Êý¹¦ÄÜ£ºÉ¾³ýpºó¸ö½Úµã
node* DelList(node *p)
{
 if (p == NULL)
  return NULL;  node *q;
 q = p->pNext;
 p->pNext = q->pNext;
 free(q)
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(1) | ä¯ÀÀ()
 
2006-07-24 17:35
#include <list>
#include <iostream> using namespace std; // º¯Êý¹¦ÄÜ£ºÕýÐòÏÔʾ
void Display(list <int> c)
{
 list <int>::iterator Iter;  cout << "list =";
 for ( Iter = c.begin( ); Iter != c.end( ); Iter++ )
  cout << " " << *Iter;
 cout << endl;
} // º¯Êý¹¦ÄÜ£ºµ¹ÐòÏÔʾ
void Rev_Display(list <int> c)
{
 list <int>::reverse_iterator rvIter;
 
 cout << "list =";
 for ( rvIter = c.rbegin( ); rvIter != c.rend( ); rvIter++ )
  cout << " " << *rvIter;
 cout << endl;
} int main( )
{
 list <int> c1, c2;
 list <int>::iterator Iter;
 c1.push_back( 10 ); // c1,c2¸÷³õʼ»¯3¸öÖµ
 c1.push_back( 20 );
 c1.push_back( 30 );
 c2.push_back( 40 );
 c2.push_back( 50 );
&nb
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:34
#include <iostream.h> void main()
{
 //´æ·Å100¸öʵÊýµÄÊý×é
 double Num[100] = {4543.9,4543.9,3,45,654.7,7,66,35,45,4,6,4543.9,5,46,54,6,43,5.980,34};    //¼Ç¼×î´óÖµËùÔÚλÖõÄÊý×é
 int pos[100];  //³õʼÉ趨Êý×éµÄµÚ1¸öÔªËØÎª×î´óÖµ
 int position = 0;  //jָʾλÖÃÊý×éposµÄϱê
 int j = 1;                                             
 for(int i = 1;i < 100; ++ i)
 {
  if(Num[i] > Num[position])
  {
   position = i;   //¼ÇÏÂеÄ×î´óÖµµÄλÖÃ
   j = 1;   //λÖÃÊý×éposµÄϱê»Ö¸´Îª1£¬Ï±êΪ0µÄλÖÃΪpositionÔ¤Áô
  }
  else if(Num[i
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:34
#include "stdio.h"
#include "assert.h" template <class ELEM> class Stack
{
 public:
  ELEM *ElmList;
  int top;
  int maxsize;   Stack(int size);
  ~Stack();   Push(ELEM item);
  ELEM Pop();
  ELEM GetTop();   bool IsEmpty();
  bool IsFull();
 
}; template <class ELEM>
Stack<ELEM>::Stack(int size)
{
 maxsize = size;
 ElmList = new ELEM[maxsize];
 assert(ElmList != (ELEM *)NULL);
 top = -1;
} template <class ELEM>
Stack<ELEM>::~Stack()
{
 delete ElmList;
} template <class ELEM>
bool Stack<ELEM>::IsFull()
{
 return top == maxsize - 1;
} template <class ELEM>
bool Stack<ELEM>::IsEmpty()
{
 return top == -1;
} template <class EL
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:33
/*
     ˫ջµÄÀඨÒåÈçÏ£º

     ------------------------------------------------------------------
         | ---------------> |              |  <-----------------  |
         | <--------------- |              |  ----------------->  |
     ------------------------------------------------------------------
         |                  |              |                      |

Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:33

#include <stdio.h>
#include <stack>

void main()
{
 using namespace std;
 stack <int> s1;
 int n = 0;

 printf("Please input a number:\n");
 scanf("%d", &n);

 while (n)
 {
  s1.push(n % 2);
  n /= 2;
 }

 while (!s1.empty())
 {
  printf("%d", s1.top());
  s1.pop();
 }
 
 printf("\n\n");
}

Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:33
// ÊäÈ룺whli##ilr#e(s#*s)
//          outcha@putchar(*s=#++)
// Êä³ö£ºwhile(*s)
//          putchar(*s++);     #include <stdio.h>
#include <stack> void LineEdit()
{
 using namespace std;
 stack <char> stackEdit, s1;
 char ch;  ch = getchar();
 while (ch != EOF)
 {
  while (ch != EOF && ch != '\n')
  {
   switch(ch)
   {
    case '#':
     stackEdit.pop();
     break;
    case '@':
     {
      whil
Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
2006-07-24 17:33

#include <stdio.h>
#include <stack>

int f(int n)
{
 if (n == 0) return 0;
 if (n == 1) return 1;
 if (n > 1) return f(n - 1) + f(n - 2);
 
 return -1;
}

int f1(int n)
{
 using std::stack;
 stack<int> aStack;

 if (n > 1)
 {
  aStack.push(n-1);
  aStack.push(n-2);
 }

 int s = 0, temp;
 while (!aStack.empty())
 {
  temp = aStack.top();
  aStack.pop();

  if (temp > 1)
  {
   aStack.push(temp-1);
   aStack.push(temp-2);
  }
  if (temp == 1)
   s ++;
 }
 return s;
}

void main()
{
 int n = 10;
 printf("the result is : %d\n", f(n));
 pri

Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(1) | ä¯ÀÀ()
 
2006-07-24 17:32

#include <stdio.h>
#include <stack>

int Maze[100] = {1,1,1,1,1,1,1,1,1,1,
     1,0,0,1,0,0,0,1,0,1,
     1,0,0,1,0,0,0,1,0,1,
     1,0,0,0,0,1,1,0,0,1,
     1,0,1,1,1,0,0,0,0,1,
     1,0,0,0,1,0,0,0,0,1,
     1,0,1,0,0,0,1,0,0,1,
     1,0,1,1,1,0,1,1,0,1,
     1,1,0,0,0,0,0,0,0,1,
     1,1,1,1,1,1,1,1,1,1};

typedef struct Path
{
 int ord;
 int seat;
 int di;
}Path;

bool Pass(int curpos)
{
 if (Maze[curpos] == 0)
  return true;
 else
  return false;
}

void FootPrint(int curpos)
{
 Maze[curpos] = 1;
}

void MarkPrint(int curpos)
{
 Maze[curpos] = 1;
}

int N

Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(2) | ä¯ÀÀ()
 
2006-07-24 17:32

#include <stdio.h>
#include <stack>

void main()
{
 char A[100] = "3.5.2.-*7.+@";
 int k, i = 0;
 int op1, op2;

 using namespace std;
 stack <int> stOPND;

 //memset(A, 0, 100);
 //scanf("%s", &A);

 while(A[i] != '@')
 {
  if (A[i] >= '0' && A[i] <= '9')
  {
   k = 0;
   while(A[i] != '.')
   {
    k = k * 10 + A[i] - '0';
    i ++; 
   }
   stOPND.push(k);
  }

  switch(A[i])
  {
   case '+':
    {
     op1 = stOPND.top();
     stOPND.pop();

Àà±ð£ºÊý¾Ý½á¹¹ | ÆÀÂÛ(0) | ä¯ÀÀ()
 
     
 
 
ÎÄÕ·ÖÀà
 
     
 
ÎÄÕ´浵
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
     
 
×îÐÂÎÄÕÂÆÀÂÛ
   
 
 
 
 
 
     


©2009 Baidu