摘要: Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less tha 阅读全文
posted @ 2018-10-05 23:29 Sunrisepeak 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 引子: 例1:求1+2+....+n. 例2:求1-2+3-4.....+(-1)^(n-1)n. 时间复杂度:O(n) 例3:求1-3+5-7......(-1)n-1(2n-1). 时间复杂度:O(n) 例4:1!-3!+5!-7!.....(-1)(n-1)(2n-1)! 时间复杂度:O(n2 阅读全文
posted @ 2018-10-05 00:38 Sunrisepeak 阅读(265) 评论(0) 推荐(0) 编辑