用Python写一个函数实现1+2+...+n的功能。方法1、使用for循环def accSum(n): sum = 0 for i in range(1, n+1): #[1,n+1) sum += i return sum方法2、 ...
確定! 回上一頁