08 2013 档案
摘要:Problem Description
Given a positive integer N, you should output the leftmost digit of N^N.
阅读全文
摘要:An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, it slips down d inches. The process of climbing and resting then repeats. How long before the worm climbs out of the well? We'll always count a portion of a minute as a whole minute and if the worm just reaches the top of the well at the end of its climbing, we'll assume the worm makes it out.
阅读全文
摘要:Ignatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him?
Given a positive integers Y which indicate the start year, and a positive integer N, your task is to tell the Nth leap year from year Y.
阅读全文
摘要:Larry graduated this year and finally has a job. He’s making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to figure out what’s been going on with his money. Larry has his bank account statements and wants to see how much money he has. Help Larry by writing a program to take his closing balance from each of the past twelve months and calculate his average account
阅读全文
摘要:We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China!
“Oh, God! How terrible! ”
阅读全文
摘要:在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数.
例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图:
阅读全文
摘要:网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。
阅读全文
摘要:“回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。
阅读全文
摘要:约瑟夫问题:有n个人,其编号分别为1,2,3,…,n。这n个人按顺序排成一个圈。现在给定s和d,从第s个人开始从1依次报数,数到d的人出列,
阅读全文
摘要:链表中的每一个元素都包含一个成为节点的结构,每向链表中增加一个元素,就会产生一个与之相关的节点,每个节点与它相邻的节点相连接,这里教我们写一个自己的MyLinkedList
阅读全文
摘要:实现线性表的方法有两种:
1、数组(arry),数组是动态的创建的,如果元素超过了数组的容量,就会创建一个新的数组并且把当前的数组元素复制到更大的数组里;
2、连式结构(linked structure)。连式结构有节点构成,节点是动态创建的。
阅读全文
摘要:Problem Description
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.
This year, they decide to leave this lovely job to you.
阅读全文
摘要:equal(s.begin(), s.end(), s.rbegin());回文串
阅读全文
摘要:这个程序用来查找被称为url(统一资源地)的万维网地址,输入一行包含url的字符串,程序会帮你识别并输出字符串里所包含的全部url。
阅读全文
摘要:标准库定义了四种关联容器:map是其中之一(另外还有set、multimap、multiset)。map的元素以键-值(key-value),在学了顺序容器之后,再学习关联容器,就比较比较好理解了。
阅读全文
摘要:vector容器是一个模板类,可以存放任何类型的对象,因而可以定义任意多种数据类型。vector对象可以在运行时高效地添加元素,并且vector中元素是连续存储的。
阅读全文

浙公网安备 33010602011771号