沧桑不尽
无穷的沧桑,不尽的落叶
摘要: //队列非递归遍历需要template<class NodeType>class Stack{public: Stack(){nIndex = 0;} ~Stack(){} //入栈 void Push(NodeType *p) { arr[nIndex] = p; ++nIndex; } //获取栈顶元素 NodeType *Top() { --nIndex; if (nIndex<0) { nIndex = 0; return NULL; } return arr[nIndex]; } bool IsEmpty() { return nIndex == 0; }priva 阅读全文
posted @ 2011-03-11 13:40 沧桑不尽 阅读(531) 评论(0) 推荐(0) 编辑
摘要: int _tmain(int argc, _TCHAR* argv[]){ char num1[100] = {'1'}; char num2[100] = {'2'}; char sum[101] = {0}; for (int i=0;i<100;++i) { num1[i] = '1'; num2[i] = '9'; } int nJinWei = 0; int nTmpSum = 0; for (int i=0;i<100;++i) { nTmpSum = (num1[i] - '0') + ( 阅读全文
posted @ 2011-03-11 10:57 沧桑不尽 阅读(307) 评论(0) 推荐(0) 编辑