2014年4月18日
摘要: Description桌上有一叠牌,从第一张牌(即位于顶面的牌)开始从上往下依次编号为1~n。当至少还剩两张牌时进行以下操作:把第一张牌扔掉,然后把新的第一张放到整叠牌的最后。输入n,输出每次扔掉的牌,以及最后剩下的牌。Input第一行为一个整数t(0int main(){int test, n, ... 阅读全文
posted @ 2014-04-18 22:31 左手代码右手诗 阅读(175) 评论(0) 推荐(0) 编辑
摘要: F[0]=0;F[1]=1;F[n]=F[n-1]+F[n-2], for n>1给出n (0#include// 矩阵快速幂void xx(longlong a[][3],longlong b[][3],longlong m){longlong tmp[3][3]; tmp[1][1]= tmp[... 阅读全文
posted @ 2014-04-18 22:29 左手代码右手诗 阅读(648) 评论(0) 推荐(0) 编辑
  2014年4月10日
摘要: // List.h#ifndef SSCPP2014_DOULIST_A_H#define SSCPP2014_DOULIST_A_H#includestructDouListNode{int elem;DouListNode*prev,*next;DouListNode(int e =0,DouListNode*p =0,DouListNode*n =0){ elem = e; prev = p; next = n;}};classDouList{private:DouListNode*m_head,*m_tail;public:DouList();DouList(constDouList& 阅读全文
posted @ 2014-04-10 21:08 左手代码右手诗 阅读(537) 评论(0) 推荐(0) 编辑