TDD
ShuaiLewis
日出东海落西山,苦也一天,愁也一天!
展开
-
2.TDD实现字符串排列组合
题目地址:http://cyber-dojo.org/setup_default_start_point/show/?from=individual , 第二题。题目如下: Write a program to generate all potential anagrams of an input string.For example, the potential anagrams of ...原创 2018-09-05 11:37:09 · 217 阅读 · 0 评论 -
1.TDD实现100door的问题
这是http://cyber-dojo.org/setup_default_start_point/show/?from=individual网站上的第一题。题目如下:Q:100 doors in a row are all initially closed. You make 100 passes by the doors. The first time through, you visit...原创 2018-09-03 18:34:43 · 281 阅读 · 0 评论 -
3.TDD实现成对扩符问题
1.题目: Write a program to determine if the the parentheses (),the brackets [], and the braces {}, in a string are balanced.For example: {{)(}} is not balanced because ) comes before ( ...原创 2018-09-12 09:48:23 · 295 阅读 · 0 评论 -
4.TDD实现幸运抽奖
1.题目 有 n 位幸运观众参加抽奖,生成对应的随机数(1 ~ n),按倍数删除数据(若是1,只删除1;若是2,则删除#2,#4,#6…;若是3,则删除#3,#6,#9…)。若剩余99位数字,再生成随机数(1~99),再按倍数删除数据… 直到只剩下最后一位,即为中奖观众2.TDD测试package cs.luck.draw;import java.util.Iterator;...原创 2018-09-12 10:12:39 · 140 阅读 · 0 评论 -
5.TDD实现10回合保龄球比赛
1.题目 题目地址:http://cyber-dojo.org/setup_default_start_point/show/?from=individual Write a program to score a game of Ten-Pin Bowling. Input: string (described below) representing a bowling game ...原创 2018-09-13 20:03:00 · 604 阅读 · 0 评论 -
6.TDD实现最接近0的数
一.题目Given a list of numbers find the closest to zero.If there is a tie, choose thepositive value.本人修改了题目:给定一个数列表,找到最接近0的数。 如果两个数相等,选择正值。如果有多个相等的最接近数,选第一个出现的即可。这题算是我做过的TDD中最简单的。二.最终代码展示1.实现packag...原创 2018-09-21 11:14:22 · 205 阅读 · 0 评论