上一页 1 ··· 3 4 5 6 7
posted @ 2016-03-21 15:42 咸_鱼 Views(61) Comments(0) Diggs(0) Edit
Tasks: a) Description of triangle problem: Function triangle takes three integers a,b,c which are length of triangle sides; calculates whether the tri Read More
posted @ 2016-03-18 19:34 咸_鱼 Views(151) Comments(0) Diggs(0) Edit
1 左边的程序fault是for中 i>0;右边fault是for中数组从头至尾循环 和 return -1 放在了for里面。 2 左边test:x[3,5,2]; y=2 expected=2. 右边test:x=[0,1,1] expected=0; 3 左边test:x[3,5,2]; y= Read More
posted @ 2016-03-17 23:37 咸_鱼 Views(148) Comments(0) Diggs(0) Edit
以前刚学C++时遇到的一个题,记得是判断一个20*20的方格中是否有至少5个棋子连成一条线,当时我用的是二维数组保存的方格位置是否放有棋子,数组为【21】【21】,但是总是不能通过,最后改成【25】【25】的数组后就通过了,不知道为什么会这样。最后仔细想才知道是数组越界了。也是新手经常犯得错误了。 Read More
posted @ 2016-03-08 08:42 咸_鱼 Views(86) Comments(0) Diggs(0) Edit
上一页 1 ··· 3 4 5 6 7