CY_

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2014年3月26日

摘要: Counting TrianglesProblem DescriptionGiven an equilateral triangle with n thelength of its side, program to count how many triangles in it.InputThe length n (n using namespace std;int num[1000];void cal(){ num[1] = 1;int i; for(i = 2;i>n&&n) { sum = n*(n+1)*(n+2)/6; n-=1; ... 阅读全文
posted @ 2014-03-26 20:23 CY_ 阅读(251) 评论(0) 推荐(0) 编辑